commit 1c83af511d4057ae5373a721ee255375787acdc3
parent e3417dea16462d40055d71c505114cf32ed8a5db
Author: Joris Vink <joris@coders.se>
Date: Thu, 25 Sep 2014 22:20:47 +0200
Make kore_mem_free() behave like free() and don't do anything if NULL is passed in.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/mem.c b/src/mem.c
@@ -107,6 +107,9 @@ kore_mem_free(void *ptr)
u_int8_t *addr;
struct meminfo *mem;
+ if (ptr == NULL)
+ return;
+
mem = KORE_MEMINFO(ptr);
if (mem->magic != KORE_MEM_MAGIC)
fatal("kore_mem_free(): magic boundary not found");