summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorMichael Zimmermann <sigmaepsilon92@gmail.com>2016-05-09 10:01:49 +0800
committerFeng Tian <feng.tian@intel.com>2016-05-09 16:18:00 +0800
commit140cc8000f74258a7e3985452538415b77b66b94 (patch)
tree5465eedaf8c8927e4390b7080d83f656f5896e23 /MdeModulePkg
parent6e7423c3c2ff56c9256b92a845b3e0c959ab0d74 (diff)
downloadedk2-platforms-140cc8000f74258a7e3985452538415b77b66b94.tar.xz
MdeModulePkg: FileExplorerLib: prevent freeing null pointer
when there's no volume label 'Info' can be NULL Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/FileExplorerLib/FileExplorer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
index 9f75d6ede5..59c851b7b3 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
@@ -775,7 +775,9 @@ LibFindFileSystem (
MenuEntry->DisplayString,
NULL
);
- FreePool (Info);
+
+ if (Info != NULL)
+ FreePool (Info);
OptionNumber++;
InsertTailList (&gFileExplorerPrivate.FsOptionMenu->Head, &MenuEntry->Link);