From 3083423fb74e6cd4463e823ee6e37b467079bf1f Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 21 Feb 2004 18:31:48 +0000 Subject: [PATCH] Valgrind lint. Not sure if I'd classify this truly as memory leaks rather than explicit deallocations before terminating. --- src/iso-info.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/iso-info.c b/src/iso-info.c index 8be6468e..44c185ed 100644 --- a/src/iso-info.c +++ b/src/iso-info.c @@ -1,5 +1,5 @@ /* - $Id: iso-info.c,v 1.3 2004/02/08 03:35:24 rocky Exp $ + $Id: iso-info.c,v 1.4 2004/02/21 18:31:48 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -114,8 +114,6 @@ parse_options (int argc, const char *argv[]) { const char *remaining_arg = poptGetArg(optCon); if ( remaining_arg != NULL) { - source_name = strdup(remaining_arg); - if ( (poptGetArgs(optCon)) != NULL) { fprintf (stderr, "%s: Source specified in previously %s and %s\n", @@ -123,6 +121,7 @@ parse_options (int argc, const char *argv[]) poptFreeContext(optCon); exit (EXIT_FAILURE); } + source_name = strdup(remaining_arg); } } @@ -276,6 +275,7 @@ main(int argc, const char *argv[]) iso = iso9660_open (source_name); if (iso==NULL) { + free(source_name); err_exit("%s: Error in opening device driver\n", program_name); } @@ -288,6 +288,7 @@ main(int argc, const char *argv[]) print_iso9660_fs(iso); } + free(source_name); iso9660_close(iso); /* Not reached:*/ free(program_name);