From 8c79cbade5201eb7140dc17b099bbf66bb26e420 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 24 Jul 2010 17:54:55 +0200 Subject: [PATCH] Fix memory leak in MRSETS --- src/data/dictionary.c | 2 +- src/data/mrset.c | 1 + src/data/sys-file-reader.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) 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); -- 2.30.2