John Darrington <[EMAIL PROTECTED]> writes:

> I notice that test/xforms/casefile also leaks a lot of memory.  I
> don't know if these problems are related or not.

Probably not.  I investigated the former first.  Here's the fix
that I checked in.  I will look at RANK leaks now.

--- casefile-test.c.~1.5.~      2006-10-07 19:23:41.000000000 -0700
+++ casefile-test.c     2006-10-14 16:20:25.000000000 -0700
@@ -232,14 +232,17 @@ test_casereader_clone (struct casereader
 
   /* Read a 3rd of the cases */
   for ( i = 0 ; i < case_cnt / 3 ; ++i ) 
-    casereader_read (reader1, &c1);
+    {
+      casereader_read (reader1, &c1);
+      case_destroy (&c1);
+    }
 
   clone = casereader_clone (reader1);
 
   /* Copy all the cases into a new file */
   while( casereader_read (reader1, &c1))
     { 
-      casefile_append (newfile, &c1);
+      casefile_append_xfer (newfile, &c1);
       cases ++;
     }
 
@@ -254,13 +257,19 @@ test_casereader_clone (struct casereader
       cases --;
 
       if ( ! casereader_read_xfer (newreader, &c2) ) 
-       break;
+        {
+          case_destroy (&c1);
+          break; 
+        }
       
       v1 = case_data_all (&c1) ;
       v2 = case_data_all (&c2) ;
 
       if ( 0 != memcmp (v1, v2, value_cnt * MAX_SHORT_STRING))
        fail_test ("Cloned reader read different value at case %ld", cases);
+
+      case_destroy (&c1);
+      case_destroy (&c2);
     }
 
   if ( cases > 0 ) 

-- 
"The fact is, technical people are better off not looking at patents. If
 you don't know what they cover and where they are, you won't be knowingly
 infringing on them. If somebody sues you, you change the algorithm or you
 just hire a hit-man to whack the stupid git." --Linus Torvalds


_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to