From: "David A. Long" <[email protected]>

Freeing a NULL pointer does not really have to be considered a fatal
error.

Signed-off-by: David A. Long <[email protected]>
---
 MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c 
b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c
index 0ccb524..3333bc7 100644
--- a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c
@@ -811,7 +811,10 @@ FreePool (
 {
   EFI_STATUS    Status;
 
-  Status = gBS->FreePool (Buffer);
-  ASSERT_EFI_ERROR (Status);
+  if (Buffer == NULL) {
+    DEBUG((EFI_D_WARN, "FreePool: attempt to free NULL pointer\n"));
+  } else {
+    Status = gBS->FreePool (Buffer);
+    ASSERT_EFI_ERROR (Status);
+  }
 }
-
-- 
1.8.1.2


_______________________________________________
boot-architecture mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/boot-architecture

Reply via email to