Revision: 14316
          http://edk2.svn.sourceforge.net/edk2/?rev=14316&view=rev
Author:   sfu5
Date:     2013-04-25 01:38:06 +0000 (Thu, 25 Apr 2013)
Log Message:
-----------
Check for NULL pointer before free it.
Signed-off-by: Fu Siyuan <[email protected]>
Reviewed-by: Ye Ting  <[email protected]>
Reviewed-by: Dong Guo <[email protected]>

Modified Paths:
--------------
    
trunk/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c

Modified: 
trunk/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
===================================================================
--- 
trunk/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
     2013-04-25 01:33:43 UTC (rev 14315)
+++ 
trunk/edk2/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
     2013-04-25 01:38:06 UTC (rev 14316)
@@ -1,7 +1,7 @@
 /** @file
   Internal file explorer functions for SecureBoot configuration module.
 
-Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -323,7 +323,7 @@
 
   FileContext = (SECUREBOOT_FILE_CONTEXT *) MenuEntry->FileContext;
 
-  if (!FileContext->IsRoot) {
+  if (!FileContext->IsRoot && FileContext->DevicePath != NULL) {
     FreePool (FileContext->DevicePath);
   } else {
     if (FileContext->FHandle != NULL) {
@@ -340,7 +340,9 @@
 
   FreePool (FileContext);
 
-  FreePool (MenuEntry->DisplayString);
+  if (MenuEntry->DisplayString != NULL) {
+    FreePool (MenuEntry->DisplayString);
+  }
   if (MenuEntry->HelpString != NULL) {
     FreePool (MenuEntry->HelpString);
   }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to