From: John Darrington Date: Sat, 28 Jul 2012 16:27:22 +0000 (+0200) Subject: Fixed some of the leaks in REGRESSION X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8566274867b259ca29b7ae8c867194099fc27f4;p=pspp Fixed some of the leaks in REGRESSION --- diff --git a/src/language/stats/regression.c b/src/language/stats/regression.c index 0a2e2a8cf6..9974ea4c2c 100644 --- a/src/language/stats/regression.c +++ b/src/language/stats/regression.c @@ -403,9 +403,15 @@ cmd_regression (struct lexer *lexer, struct dataset *ds) subcommand_save (®ression); + free (regression.models); + free (regression.vars); + free (regression.dep_vars); return CMD_SUCCESS; error: + free (regression.models); + free (regression.vars); + free (regression.dep_vars); return CMD_FAILURE; } @@ -671,10 +677,10 @@ run_regression (const struct regression *cmd, struct casereader *input) } else { - msg (SE, + msg (SE, _("No valid data found. This command was skipped.")); - linreg_free (models[k]); - models[k] = NULL; + linreg_free (models[k]); + models[k] = NULL; } gsl_matrix_free (this_cm); } diff --git a/src/math/linreg.c b/src/math/linreg.c index 90c62a5258..7c85634a50 100644 --- a/src/math/linreg.c +++ b/src/math/linreg.c @@ -118,6 +118,7 @@ linreg_free (void *m) { gsl_vector_free (c->indep_means); gsl_vector_free (c->indep_std); + gsl_vector_free (c->ss_indeps); gsl_matrix_free (c->cov); free (c->indep_vars); free (c->coeff);