Fix memory leak in rank_sorted_casefile().
authorBen Pfaff <blp@gnu.org>
Sat, 14 Oct 2006 23:55:18 +0000 (23:55 +0000)
committerBen Pfaff <blp@gnu.org>
Sat, 14 Oct 2006 23:55:18 +0000 (23:55 +0000)
src/language/stats/ChangeLog
src/language/stats/rank.q

index c96b2861b7e9b458cd915cbd54148c627c9a0528..e891f6d5ee65cdc713962803aa8ecdf4b659bc9c 100644 (file)
@@ -1,3 +1,8 @@
+Sat Oct 14 16:52:28 2006  Ben Pfaff  <blp@gnu.org>
+
+       * rank.q: (rank_sorted_casefile) Add some missing case_destroy()
+       calls to fix a memory leak.
+
 Sun Oct  8 09:45:40 WST 2006 John Darrington <john@darrington.wattle.id.au>
 
        * rank.q: Plugged a small memory leak which occurred under error
index 59846c85bf20f27903bb280a87a0ae769db55163..491160b6097a702eb51854b06e2cbdb6b42cd02d 100644 (file)
@@ -626,11 +626,14 @@ rank_sorted_casefile (struct casefile *cf,
                          dest_idx, dest);
 
               w = 0.0;
+              case_destroy (&group_case);
               case_move (&group_case, &this_case);
             }
          if ( !value_is_missing (mv, this_value) )
            w += c;
+          case_destroy (&this_case);
         }
+      case_destroy (&group_case);
       rank_cases (pos, ULONG_MAX, ultimate_crit, mv, w,
                  rs, n_rank_specs, dest_idx, dest);
     }