From: Philippe Waroquiers Date: Mon, 27 Feb 2012 21:52:45 +0000 (+0000) Subject: Fix one more leak detected by running memcheck in memcheck X-Git-Tag: svn/VALGRIND_3_8_0~446 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=704e5c19d17a3efb2f667271e7d14ffdb1c02bb6;p=thirdparty%2Fvalgrind.git Fix one more leak detected by running memcheck in memcheck (started to run regression tests in an outer) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12407 --- diff --git a/memcheck/mc_leakcheck.c b/memcheck/mc_leakcheck.c index 85e0b26cd8..8d462b94c7 100644 --- a/memcheck/mc_leakcheck.c +++ b/memcheck/mc_leakcheck.c @@ -943,10 +943,11 @@ static void print_results(ThreadId tid, LeakCheckParams* lcp) // proper printing of the deltas between previous search and this search. n_lossrecords = get_lr_array_from_lr_table(); for (i = 0; i < n_lossrecords; i++) { - if (lr_array[i]->num_blocks == 0) + if (lr_array[i]->num_blocks == 0) { // remove from lr_table the old loss_records with 0 bytes found VG_(OSetGen_Remove) (lr_table, &lr_array[i]->key); - else { + VG_(OSetGen_FreeNode)(lr_table, lr_array[i]); + } else { // move the leak sizes to old_* and zero the current sizes // for next leak search lr_array[i]->old_szB = lr_array[i]->szB;