Fixed an assertion failure that was triggered on Darwin by calling malloc_zone_realloc().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10600 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_malloc_wrappers.c b/drd/drd_malloc_wrappers.c
index 3dcbb44..d380ecc 100644
--- a/drd/drd_malloc_wrappers.c
+++ b/drd/drd_malloc_wrappers.c
@@ -228,7 +228,8 @@
/* 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. */