From: John Hodge Date: Sat, 10 May 2014 07:40:07 +0000 (+0800) Subject: Kernel/heap - Check for free(NULL) and silently ignore X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;ds=sidebyside;h=15ee623d18ed68984e486c4d578c7cce5377aebd;p=tpg%2Facess2.git Kernel/heap - Check for free(NULL) and silently ignore --- diff --git a/KernelLand/Kernel/heap.c b/KernelLand/Kernel/heap.c index f7054ea4..ba4c9adb 100755 --- a/KernelLand/Kernel/heap.c +++ b/KernelLand/Kernel/heap.c @@ -353,6 +353,8 @@ void Heap_Deallocate(const char *File, int Line, void *Ptr) // INVLPTR is returned from Heap_Allocate when the allocation // size is zero. if( Ptr == INVLPTR ) return; + // free(NULL) is a no-op + if( Ptr == NULL ) return; // Alignment Check if( (tVAddr)Ptr % sizeof(void*) != 0 ) {