From: John Darrington Date: Sat, 24 Jul 2010 15:54:55 +0000 (+0200) Subject: Fix memory leak in MRSETS X-Git-Tag: v0.7.6~328 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c79cbade5201eb7140dc17b099bbf66bb26e420;p=pspp-builds.git Fix memory leak in MRSETS --- diff --git a/src/data/dictionary.c b/src/data/dictionary.c index dc7e8732..9222f7ec 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -297,7 +297,7 @@ dict_destroy (struct dictionary *d) dict_clear (d); hmap_destroy (&d->name_map); attrset_destroy (&d->attributes); - free (d->mrsets); + dict_clear_mrsets (d); free (d->encoding); free (d); } diff --git a/src/data/mrset.c b/src/data/mrset.c index 2f05edb8..d1807b96 100644 --- a/src/data/mrset.c +++ b/src/data/mrset.c @@ -58,6 +58,7 @@ mrset_destroy (struct mrset *mrset) free (mrset->label); free (mrset->vars); value_destroy (&mrset->counted, mrset->width); + free (mrset); } } diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index 268023cf..b92f42a9 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -1172,6 +1172,7 @@ read_mrsets (struct sfm_reader *r, size_t size, size_t count, dict_add_mrset (dict, mrset); mrset = NULL; + stringi_set_destroy (&var_names); } mrset_destroy (mrset); close_text_record (r, text);