From 0e48b68cac4bcbcea018713027cf8f2d98f36685 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Thu, 4 Feb 2016 08:02:27 +0100 Subject: [PATCH] Fix memory leak in pspp-convert --- utilities/pspp-convert.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utilities/pspp-convert.c b/utilities/pspp-convert.c index b123e5f69e..f53e28a83e 100644 --- a/utilities/pspp-convert.c +++ b/utilities/pspp-convert.c @@ -58,7 +58,7 @@ main (int argc, char *argv[]) const char *output_filename; long long int max_cases = LLONG_MAX; - struct dictionary *dict; + struct dictionary *dict = NULL; struct casereader *reader; struct file_handle *input_fh; const char *encoding = NULL; @@ -220,6 +220,7 @@ main (int argc, char *argv[]) error (1, 0, _("%s: error writing output file"), output_filename); exit: + dict_destroy (dict); fh_unref (output_fh); fh_unref (input_fh); fh_done (); @@ -228,6 +229,7 @@ exit: return 0; error: + dict_destroy (dict); fh_unref (output_fh); fh_unref (input_fh); fh_done (); -- 2.30.2