drd, realloc() intercept: Swap freeing and cleaning memory.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12482 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_malloc_wrappers.c b/drd/drd_malloc_wrappers.c
index 92e14d7..3abdf0e 100644
--- a/drd/drd_malloc_wrappers.c
+++ b/drd/drd_malloc_wrappers.c
@@ -228,9 +228,9 @@
VG_(memcpy)(p_new, p_old, mc->size);
/* Free old memory. */
- VG_(cli_free)(p_old);
if (mc->size > 0)
s_stop_using_mem_callback(mc->data, mc->size);
+ VG_(cli_free)(p_old);
VG_(HT_remove)(s_malloc_list, (UWord)p_old);
/* Update state information. */