From: Ben Pfaff Date: Thu, 13 Sep 2007 04:23:15 +0000 (+0000) Subject: (postcalc): Free sorted_tab and the structures that it points to, to X-Git-Tag: v0.6.0~277 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab68e4ef0a6f43179bdd5bebe959ef391489a7a;p=pspp-builds.git (postcalc): Free sorted_tab and the structures that it points to, to plug a memory leak. Fixes bug #20910. Thanks to John Darrington for reporting this bug and for review. --- diff --git a/src/language/stats/ChangeLog b/src/language/stats/ChangeLog index e9ec8fcd..2499a1a6 100644 --- a/src/language/stats/ChangeLog +++ b/src/language/stats/ChangeLog @@ -1,3 +1,9 @@ +2007-09-12 Ben Pfaff + + * crosstabs.q (postcalc): Free sorted_tab and the structures that + it points to, to plug a memory leak. Fixes bug #20910. Thanks to + John Darrington for reporting this bug and for review. + 2007-09-04 Ben Pfaff * crosstabs.q (cmd_crosstabs): Free xtab and the structures that diff --git a/src/language/stats/crosstabs.q b/src/language/stats/crosstabs.q index 8adf044c..0dbb8371 100644 --- a/src/language/stats/crosstabs.q +++ b/src/language/stats/crosstabs.q @@ -827,6 +827,16 @@ postcalc (void) } hsh_destroy (gen_tab); + if (mode == INTEGER) + { + int i; + for (i = 0; i < n_sorted_tab; i++) + { + free (sorted_tab[i]->u.data); + free (sorted_tab[i]); + } + free (sorted_tab); + } } static void insert_summary (struct tab_table *, int tab_index, double valid);