Memory leak patrol.
[pspp-builds.git] / src / language / stats / rank.q
index c102d195c08c3b09227f6fe6864c362f90fd4ea0..59846c85bf20f27903bb280a87a0ae769db55163 100644 (file)
@@ -264,7 +264,8 @@ rank_cmd (const struct sort_criteria *sc,
 
       /* Obtain active file in CF. */
       if (!procedure (NULL, NULL))
-       return false;
+       goto error;
+
       cf = proc_capture_output ();
 
       /* Sort CF into SORTED_CF. */
@@ -285,9 +286,13 @@ rank_cmd (const struct sort_criteria *sc,
       
       proc_set_source (storage_source_create (out));
     }
-  free (criteria.crits);
 
+  free (criteria.crits);
   return result ; 
+
+error:
+  free (criteria.crits);
+  return false ;
 }
 
 /* Hardly a rank function !! */