summaryrefslogtreecommitdiff
path: root/Cryptlib/SysCall/BaseMemAllocation.c
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@canonical.com>2016-10-01 14:18:49 -0700
committerSteve Langasek <steve.langasek@canonical.com>2016-10-01 14:18:49 -0700
commitb65e78ec015a308c1798e602c94502327cc90cd9 (patch)
tree4185dc52bcba0af1f815b88e100cd68a626916ca /Cryptlib/SysCall/BaseMemAllocation.c
parent21ebe03556d7030055644f46efd3c165396a7a75 (diff)
parent86b44a70f0e22233427cef3e966869e59b5e9dd5 (diff)
downloadefi-boot-shim-b65e78ec015a308c1798e602c94502327cc90cd9.tar.gz
efi-boot-shim-b65e78ec015a308c1798e602c94502327cc90cd9.zip
Resync with Ubuntu, including patch to fix debian/copyright.
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);
+ }
}