From 4434d8ba363900e47190f39297ee690485794c1c Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 31 Oct 2012 21:29:54 -0200 Subject: [PATCH] modprobe: exit in one place --- tools/modprobe.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/modprobe.c b/tools/modprobe.c index b8a6415..d03bce6 100644 --- a/tools/modprobe.c +++ b/tools/modprobe.c @@ -937,16 +937,12 @@ static int do_modprobe(int argc, char **orig_argv) break; case 'V': puts(PACKAGE " version " VERSION); - if (argv != orig_argv) - free(argv); - free(config_paths); - return EXIT_SUCCESS; + err = EXIT_SUCCESS; + goto done; case 'h': help(basename(argv[0])); - if (argv != orig_argv) - free(argv); - free(config_paths); - return EXIT_SUCCESS; + err = EXIT_SUCCESS; + goto done; case '?': goto cmdline_failed; default: @@ -1019,6 +1015,7 @@ static int do_modprobe(int argc, char **orig_argv) if (use_syslog) closelog(); +done: if (argv != orig_argv) free(argv); -- 2.7.4