From d043fde2b737897e3372670afc47eb648c17624b Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 24 Jan 2005 04:29:53 +0000 Subject: [PATCH] Fixed a whole lot more memory leaks. --- src/ChangeLog | 6 ++++++ src/glob.c | 7 ++++--- src/oneway.q | 1 + src/q2c.c | 3 +++ src/t-test.q | 4 ++++ src/vfm.c | 9 +++------ tests/bugs/examine-1sample.sh | 4 ++-- tests/bugs/t-test-alpha.sh | 4 ++-- tests/bugs/t-test-alpha2.sh | 4 ++-- tests/bugs/t-test-with-temp.sh | 6 +++--- tests/bugs/val-labs-trailing-slash.sh | 4 ++-- tests/command/oneway-with-splits.sh | 4 ++-- tests/command/oneway.sh | 4 ++-- tests/command/sort.sh | 4 ++-- tests/command/t-test-1-sample-missing-anal.sh | 8 ++++---- tests/command/t-test-1-sample-missing-list.sh | 8 ++++---- tests/command/t-test-1s.sh | 4 ++-- tests/command/t-test-groups.sh | 4 ++-- tests/command/t-test-indep-missing-anal.sh | 8 ++++---- tests/command/t-test-indep-missing-list.sh | 8 ++++---- tests/command/t-test-paired-missing-anal.sh | 8 ++++---- tests/command/t-test-paired-missing-list.sh | 8 ++++---- tests/command/t-test-pairs.sh | 4 ++-- tests/command/trimmed-mean.sh | 4 ++-- 24 files changed, 70 insertions(+), 58 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0e90b935..db74ea37 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +Mon Jan 24 12:24:36 WST 2005 John Darrington + + * glob.c oneway.q q2c.c t-test.q vfm.c: Still *more* memory leaks + fixed. + + Fri Jan 21 19:54:14 WST 2005 John Darrington * linked-list.[ch] Added diff --git a/src/glob.c b/src/glob.c index 159c4829..9cbcc0c6 100644 --- a/src/glob.c +++ b/src/glob.c @@ -184,9 +184,10 @@ init_glob (int argc UNUSED, char **argv) void done_glob(void) { - dict_destroy(default_dict); - free(logfn); - done_settings(); + cancel_transformations (); + dict_destroy (default_dict); + free (logfn); + done_settings (); ds_destroy (&tokstr); fh_done(); diff --git a/src/oneway.q b/src/oneway.q index 84d50c16..1d208204 100644 --- a/src/oneway.q +++ b/src/oneway.q @@ -140,6 +140,7 @@ cmd_oneway(void) multipass_procedure_with_splits (run_oneway, &cmd); + free_oneway(&cmd); return CMD_SUCCESS; } diff --git a/src/q2c.c b/src/q2c.c index aaf3343c..13613204 100644 --- a/src/q2c.c +++ b/src/q2c.c @@ -2058,6 +2058,9 @@ dump_free (int persistent) { switch (sbc->type) { + case SBC_VARLIST: + dump (0, "free (p->v_variables);"); + break; case SBC_STRING: dump (0, "free (p->s_%s);", st_lower (sbc->name)); break; diff --git a/src/t-test.q b/src/t-test.q index fe59334c..4d58206d 100644 --- a/src/t-test.q +++ b/src/t-test.q @@ -267,6 +267,7 @@ cmd_t_test(void) msg(SE, _("TESTVAL, GROUPS and PAIRS subcommands are mutually exclusive.") ); + free_t_test(&cmd); return CMD_FAILURE; } } @@ -283,6 +284,7 @@ cmd_t_test(void) if (cmd.sbc_variables) { msg(SE, _("VARIABLES subcommand is not appropriate with PAIRS")); + free_t_test(&cmd); return CMD_FAILURE; } else @@ -320,6 +322,7 @@ cmd_t_test(void) else if ( !cmd.sbc_variables) { msg(SE, _("One or more VARIABLES must be specified.")); + free_t_test(&cmd); return CMD_FAILURE; } @@ -349,6 +352,7 @@ cmd_t_test(void) } } + free_t_test(&cmd); return CMD_SUCCESS; } diff --git a/src/vfm.c b/src/vfm.c index 797167e6..0309755c 100644 --- a/src/vfm.c +++ b/src/vfm.c @@ -661,12 +661,9 @@ cancel_transformations (void) free (t_trns[i]); } n_trns = f_trns = 0; - if (m_trns > 32) - { - free (t_trns); - t_trns=NULL; - m_trns = 0; - } + free (t_trns); + t_trns=NULL; + m_trns = 0; } /* Creates a case source with class CLASS and auxiliary data AUX diff --git a/tests/bugs/examine-1sample.sh b/tests/bugs/examine-1sample.sh index b988d9e2..14206a59 100755 --- a/tests/bugs/examine-1sample.sh +++ b/tests/bugs/examine-1sample.sh @@ -48,7 +48,7 @@ mkdir -p $TEMPDIR cd $TEMPDIR activity="create program" -cat > $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < /dev/null +$SUPERVISOR $here/../src/pspp -o raw-ascii $TESTFILE > /dev/null #invert v if [ $? -eq 0 ] ; then fail ; fi diff --git a/tests/bugs/t-test-with-temp.sh b/tests/bugs/t-test-with-temp.sh index 0c463570..9a775d31 100755 --- a/tests/bugs/t-test-with-temp.sh +++ b/tests/bugs/t-test-with-temp.sh @@ -48,7 +48,7 @@ mkdir -p $TEMPDIR cd $TEMPDIR activity="create program" -cat > $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/sort.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE < $TEMPDIR/out.stat < $TESTFILE <