]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fixed an assertion failure that was triggered on Darwin by calling malloc_zone_realloc().
authorBart Van Assche <bvanassche@acm.org>
Sat, 25 Jul 2009 13:28:24 +0000 (13:28 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 25 Jul 2009 13:28:24 +0000 (13:28 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10600

drd/drd_malloc_wrappers.c

index 3dcbb44db2a8ca82632fa10662f43d6c22ecff4c..d380ecc52f58287879605efa7a78a0ed9252658f 100644 (file)
@@ -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. */