From: John Darrington Date: Tue, 12 Oct 2010 08:22:07 +0000 (+0200) Subject: Fix memory leaks in Kruskal-Wallis test X-Git-Tag: v0.7.6~31 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=758bb90bac15899ca7f18a55dc4f90e1345c7179;p=pspp-builds.git Fix memory leaks in Kruskal-Wallis test --- diff --git a/src/language/stats/kruskal-wallis.c b/src/language/stats/kruskal-wallis.c index 420b1a03..63ede78a 100644 --- a/src/language/stats/kruskal-wallis.c +++ b/src/language/stats/kruskal-wallis.c @@ -203,6 +203,17 @@ kruskal_wallis_execute (const struct dataset *ds, show_ranks_box (nst, kw, total_n_groups); show_sig_box (nst, kw); + for (i = 0 ; i < nst->n_vars; ++i) + { + struct rank_entry *mre, *next; + HMAP_FOR_EACH_SAFE (mre, next, struct rank_entry, node, &kw[i].map) + { + hmap_delete (&kw[i].map, &mre->node); + free (mre); + } + hmap_destroy (&kw[i].map); + } + free (kw); }