From: Bart Van Assche Date: Mon, 2 Apr 2012 15:46:51 +0000 (+0000) Subject: drd, realloc() intercept: Swap freeing and cleaning memory. X-Git-Tag: svn/VALGRIND_3_8_0~373 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d684ffc0d6659331e9ba94d11e6f823cbc4fbc7;p=thirdparty%2Fvalgrind.git drd, realloc() intercept: Swap freeing and cleaning memory. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12482 --- diff --git a/drd/drd_malloc_wrappers.c b/drd/drd_malloc_wrappers.c index 92e14d7e1f..3abdf0ef1c 100644 --- a/drd/drd_malloc_wrappers.c +++ b/drd/drd_malloc_wrappers.c @@ -228,9 +228,9 @@ static void* drd_realloc(ThreadId tid, void* p_old, SizeT new_size) 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. */