From: John Darrington Date: Thu, 5 Jan 2012 09:55:29 +0000 (+0100) Subject: Fix memory leaks X-Git-Tag: v0.7.9~46 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46bb129a4fd2ee138775f622e21424e53a6002af;p=pspp-builds.git Fix memory leaks --- diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index 9ec176f0..a0b49fcd 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -698,7 +698,7 @@ read_variable_record (struct sfm_reader *r, struct sfm_var_record *record) /* Read up to MAX_LABEL_LEN bytes of label. */ read_len = MIN (MAX_LABEL_LEN, len); - record->label = xmalloc (read_len + 1); + record->label = pool_malloc (r->pool, read_len + 1); read_string (r, record->label, read_len + 1); /* Skip unread label bytes. */ diff --git a/src/data/variable.c b/src/data/variable.c index 537b247c..2ceeecd2 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -158,6 +158,7 @@ var_destroy (struct variable *v) var_clear_aux (v); val_labs_destroy (v->val_labs); var_clear_label (v); + attrset_destroy (var_get_attributes (v)); free (v->name); free (v); }