summaryrefslogtreecommitdiff
path: root/Cryptlib/SysCall/BaseMemAllocation.c
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2016-09-22 10:15:26 -0400
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2016-09-22 10:15:26 -0400
commit5998f019f85f765070f049332bf68d347d60c993 (patch)
tree796531832eed643b2fec02ae7f0949e84d152968 /Cryptlib/SysCall/BaseMemAllocation.c
parente3ef28acdfacfe07c42662d86af2135d1a100c24 (diff)
parent62f0afa2ecead02b1258dabab8097ca278a22f8f (diff)
downloadefi-boot-shim-5998f019f85f765070f049332bf68d347d60c993.tar.gz
efi-boot-shim-5998f019f85f765070f049332bf68d347d60c993.zip
New upstream release.
Diffstat (limited to 'Cryptlib/SysCall/BaseMemAllocation.c')
-rw-r--r--Cryptlib/SysCall/BaseMemAllocation.c8
1 files changed, 7 insertions, 1 deletions
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);
+ }
}