From 140cc8000f74258a7e3985452538415b77b66b94 Mon Sep 17 00:00:00 2001 From: Michael Zimmermann Date: Mon, 9 May 2016 10:01:49 +0800 Subject: [PATCH] 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 Reviewed-by: Feng Tian --- MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.39.2