From: Bart Van Assche Date: Sat, 25 Jul 2009 13:28:24 +0000 (+0000) Subject: Fixed an assertion failure that was triggered on Darwin by calling malloc_zone_realloc(). X-Git-Tag: svn/VALGRIND_3_5_0~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=63a3fca401aade1c39fb2e555d57211241c02fb7;p=thirdparty%2Fvalgrind.git Fixed an assertion failure that was triggered on Darwin by calling malloc_zone_realloc(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10600 --- diff --git a/drd/drd_malloc_wrappers.c b/drd/drd_malloc_wrappers.c index 3dcbb44db2..d380ecc52f 100644 --- a/drd/drd_malloc_wrappers.c +++ b/drd/drd_malloc_wrappers.c @@ -228,7 +228,8 @@ static void* drd_realloc(ThreadId tid, void* p_old, SizeT new_size) /* Free old memory. */ VG_(cli_free)(p_old); - s_stop_using_mem_callback(mc->data, mc->size); + if (mc->size > 0) + s_stop_using_mem_callback(mc->data, mc->size); VG_(HT_remove)(s_malloc_list, (UWord)p_old); /* Update state information. */