casereader_destroy (pass0);
free (prev_values);
+ if (!matrices)
+ goto error;
+
/* Now make a second pass to fill in the other triangle from our
temporary matrix */
const int idx = var_get_dict_index (mformat->varname);
if (prev_case)
case_unref (prev_case);
- for (i = 0 ; i < n_splits; ++i)
- free (matrices[i]);
+ if (matrices)
+ for (i = 0 ; i < n_splits; ++i)
+ free (matrices[i]);
free (matrices);
casereader_destroy (casereader0);
casewriter_destroy (writer);
dnl PSPP - a program for statistical analysis.
-dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2017, 2020 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
])
AT_CLEANUP
+
+
+
+dnl A "no-crash" test. This was observed to cause problems.
+dnl See bug #58596
+AT_SETUP([Matrix data crash])
+
+AT_DATA([matrix-data.pspp], [dnl
+begin data
+corr 31
+
+matrix data
+ var1
+begin data
+ corr 1.00
+end data .
+
+matrix data
+ variables = roxtype_ var01
+ /format = upper nodiagonal.
+begin data
+])
+
+AT_CHECK([pspp -O format=csv matrix-data.pspp], [1], [ignore])
+
+AT_CLEANUP