Revision: 14689
          http://sourceforge.net/p/edk2/code/14689
Author:   jcarsey
Date:     2013-09-20 20:10:17 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
ShellPkg: Handle pool allocation failure

FreePool() will receive NULL if AllocateZeroPool() fails.
So a check for NULL is needed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sergei Antonov <[email protected]>
reviewed-by: jaben carsey <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c

Modified: trunk/edk2/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c   
2013-09-19 17:23:10 UTC (rev 14688)
+++ trunk/edk2/ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.c   
2013-09-20 20:10:17 UTC (rev 14689)
@@ -84,9 +84,9 @@
     //
     // if we got an error free the memory and return NULL
     //
-    if (EFI_ERROR(Status)) {
+    if (EFI_ERROR(Status) && (FileInfo != NULL)) {
       FreePool(FileInfo);
-      return NULL;
+      FileInfo = NULL;
     }
   }
   return (FileInfo);

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


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to