Fixed bug reporting the significance of paired value t-test.
[pspp-builds.git] / src / language / stats / correlations.q
index 0ed9cc3074c8bdfb25a236bb7a792f7d36c27451..5d543098ec986b8737a8c0cd30e198d7cdea0ce9 100644 (file)
 #include <language/data-io/file-handle.h>
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
-#include <libpspp/alloc.h>
 #include <libpspp/compiler.h>
 
+#include "xalloc.h"
+
 /* (headers) */
 
 struct cor_set
@@ -76,9 +77,13 @@ internal_cmd_correlations (struct lexer *lexer, struct dataset *ds)
   matrix_file = NULL;
 
   if (!parse_correlations (lexer, ds, &cmd, NULL))
-    return CMD_FAILURE;
+    {
+      fh_unref (matrix_file);
+      return CMD_FAILURE;
+    }
 
   free_correlations (&cmd);
+  fh_unref (matrix_file);
 
   return CMD_SUCCESS;
 }
@@ -140,6 +145,7 @@ cor_custom_matrix (struct lexer *lexer, struct dataset *ds UNUSED, struct cmd_co
     matrix_file = NULL;
   else
     {
+      fh_unref (matrix_file);
       matrix_file = fh_parse (lexer, FH_REF_FILE);
       if (matrix_file == NULL)
         return 0;