From: "David A. Long" dave.long@linaro.org
Freeing a NULL pointer does not really have to be considered a fatal error.
Signed-off-by: David A. Long dave.long@linaro.org --- 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); + } } -