]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Check for NULL pointer before free it.
authorsfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 25 Apr 2013 01:38:06 +0000 (01:38 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 25 Apr 2013 01:38:06 +0000 (01:38 +0000)
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Dong Guo <guo.dong@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14316 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c

index deff87bcbdde969aa05ef574dc3cc86e71fb8351..548d95df530ce273ab63d1048be5ec3b2f62a48e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal file explorer functions for SecureBoot configuration module.\r
 \r
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -323,7 +323,7 @@ DestroyMenuEntry (
 \r
   FileContext = (SECUREBOOT_FILE_CONTEXT *) MenuEntry->FileContext;\r
 \r
-  if (!FileContext->IsRoot) {\r
+  if (!FileContext->IsRoot && FileContext->DevicePath != NULL) {\r
     FreePool (FileContext->DevicePath);\r
   } else {\r
     if (FileContext->FHandle != NULL) {\r
@@ -340,7 +340,9 @@ DestroyMenuEntry (
 \r
   FreePool (FileContext);\r
 \r
-  FreePool (MenuEntry->DisplayString);\r
+  if (MenuEntry->DisplayString != NULL) {\r
+    FreePool (MenuEntry->DisplayString);\r
+  }\r
   if (MenuEntry->HelpString != NULL) {\r
     FreePool (MenuEntry->HelpString);\r
   }\r