From caedad6fc48edd19eaaa1006a6d9a6e032aa06ce Mon Sep 17 00:00:00 2001 From: janwas Date: Sun, 15 Aug 2004 21:48:34 +0000 Subject: [PATCH] allow freeing 0 ptrs This was SVN commit r999. --- source/lib/res/mem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/lib/res/mem.cpp b/source/lib/res/mem.cpp index c6db2a09bb..97236ddbe8 100755 --- a/source/lib/res/mem.cpp +++ b/source/lib/res/mem.cpp @@ -249,6 +249,9 @@ int mem_free_h(Handle& hm) int mem_free_p(void*& p) { + if(!p) + return 0; + Handle hm = find_alloc(p); p = 0; if(hm <= 0)