From: Ben Pfaff Date: Sat, 23 Feb 2019 01:22:06 +0000 (-0800) Subject: pspp-dump-sav: Fix memory leaks. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=334d3cf790a15d8d834469cdc8a6dea6d7f4f3c5;p=pspp pspp-dump-sav: Fix memory leaks. Found by Address Sanitizer. --- diff --git a/utilities/pspp-dump-sav.c b/utilities/pspp-dump-sav.c index 70687ebc80..0aed9cf614 100644 --- a/utilities/pspp-dump-sav.c +++ b/utilities/pspp-dump-sav.c @@ -236,6 +236,8 @@ main (int argc, char *argv[]) else if (r.compression == COMP_ZLIB) read_zlib_compressed_data (&r); + free (r.var_widths); + fclose (r.file); } @@ -1018,6 +1020,8 @@ read_character_encoding (struct sfm_reader *r, size_t size, size_t count) read_string (r, encoding, count + 1); printf ("%08llx: Character Encoding: %s\n", posn, encoding); + + free (encoding); } static void