From: John Darrington Date: Thu, 4 Feb 2016 07:02:27 +0000 (+0100) Subject: Fix memory leak in pspp-convert X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e48b68cac4bcbcea018713027cf8f2d98f36685;hp=3bda3230010cd6ca7c5509039e97b9147ade1613;p=pspp Fix memory leak in pspp-convert --- 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 ();