Free linreg struct if no valid data;
[pspp-builds.git] / src / language / stats / regression.q
index 5b063950753c3c959cded0b4ff15e08240c36ff9..abb3bd353aebea6814d55c7b7c00ab0be926f95a 100644 (file)
@@ -659,8 +659,6 @@ subcommand_save (struct dataset *ds, int save, linreg ** models)
   int n_trns = 0;
   int i;
 
-  assert (models != NULL);
-
   if (save)
     {
       /* Count the number of transformations we will need. */
@@ -954,6 +952,8 @@ run_regression (struct casereader *input, struct cmd_regression *cmd,
        {
          msg (SE,
               gettext ("No valid data found. This command was skipped."));
+         linreg_free (models[k]);
+         models[k] = NULL;
        }
     }