]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix one more leak detected by running memcheck in memcheck
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 27 Feb 2012 21:52:45 +0000 (21:52 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 27 Feb 2012 21:52:45 +0000 (21:52 +0000)
(started to run regression tests in an outer)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12407

memcheck/mc_leakcheck.c

index 85e0b26cd84f54fb6af96cd75bcbed26b2256e39..8d462b94c70cee7e5af23077179dece88d1e1654 100644 (file)
@@ -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;