summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/libc/malloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/malloc.c b/payloads/libpayload/libc/malloc.c
index 48bf32ee3b..20f9ef38e1 100644
--- a/payloads/libpayload/libc/malloc.c
+++ b/payloads/libpayload/libc/malloc.c
@@ -246,6 +246,10 @@ void free(void *ptr)
hdrtype_t hdr;
struct memory_type *type = heap;
+ /* No action occurs on NULL. */
+ if (ptr == NULL)
+ return;
+
/* Sanity check. */
if (ptr < type->start || ptr >= type->end) {
type = dma;