From 7b9281af14930040ec6cb333de2d64e0ff91cf3c Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Thu, 17 Mar 2016 15:07:04 +0800 Subject: Update the CryptLib Update to the edk2 commit 5e2318dd37a51948aaf845c7d920b11f47cdcfe6 Signed-off-by: Gary Lin --- Cryptlib/SysCall/BaseMemAllocation.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Cryptlib/SysCall/BaseMemAllocation.c') diff --git a/Cryptlib/SysCall/BaseMemAllocation.c b/Cryptlib/SysCall/BaseMemAllocation.c index 75da1dd2..792b29e8 100644 --- a/Cryptlib/SysCall/BaseMemAllocation.c +++ b/Cryptlib/SysCall/BaseMemAllocation.c @@ -38,5 +38,11 @@ void *realloc (void *ptr, size_t size) /* De-allocates or frees a memory block */ void free (void *ptr) { - FreePool (ptr); + // + // In Standard C, free() handles a null pointer argument transparently. This + // is not true of FreePool() below, so protect it. + // + if (ptr != NULL) { + FreePool (ptr); + } } -- cgit v1.2.3