(postcalc): Free sorted_tab and the structures that it points to, to
[pspp-builds.git] / src / language / stats / crosstabs.q
index 8adf044c95129abbd2126f38e6a68b8aa602d9cf..0dbb83719ac434a925e36cf2040553a2f3df1c33 100644 (file)
@@ -827,6 +827,16 @@ postcalc (void)
   }
 
   hsh_destroy (gen_tab);
+  if (mode == INTEGER)
+    {
+      int i;
+      for (i = 0; i < n_sorted_tab; i++)
+        {
+          free (sorted_tab[i]->u.data);
+          free (sorted_tab[i]);
+        }
+      free (sorted_tab);
+    }
 }
 
 static void insert_summary (struct tab_table *, int tab_index, double valid);