From e8566274867b259ca29b7ae8c867194099fc27f4 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 28 Jul 2012 18:27:22 +0200 Subject: [PATCH] Fixed some of the leaks in REGRESSION --- src/language/stats/regression.c | 12 +++++++++--- src/math/linreg.c | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) 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); -- 2.30.2