From 34bcf8050e56fc799efb1013cb92ba1b44bd6df1 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 10 Apr 2006 20:39:14 +0000 Subject: [PATCH] support free(NULL), which is valid ANSI C --- DebugMemory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DebugMemory.c b/DebugMemory.c index 8f28af61..6e5156db 100644 --- a/DebugMemory.c +++ b/DebugMemory.c @@ -141,6 +141,8 @@ void DebugMemory_registerAllocation(void* data, char* file, int line) { } void DebugMemory_registerDeallocation(void* data, char* file, int line) { + if (!data) + return; assert(singleton); assert(singleton->first); DebugMemoryItem* walk = singleton->first;