xalloc.h-instead-of-alloc.h.patch from patch #6230.
[pspp-builds.git] / src / language / stats / chisquare.c
index 6b0b0567257bd80d5b812a96438464e8fc4bf75f..337203f18deff6112f11ec91efb23f1e4b79b35a 100644 (file)
@@ -29,7 +29,6 @@
 #include <data/variable.h>
 #include <language/stats/freq.h>
 #include <language/stats/npar.h>
-#include <libpspp/alloc.h>
 #include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
@@ -39,6 +38,8 @@
 
 #include <gsl/gsl_cdf.h>
 
+#include "xalloc.h"
+
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
@@ -194,6 +195,8 @@ create_variable_frequency_table (const struct dictionary *dict,
          test->n_expected, n_cells,
          var_get_name (var)
          );
+      hsh_destroy (*freq_hash);
+      *freq_hash = NULL;
       return NULL;
     }