]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
modprobe: exit in one place
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 31 Oct 2012 23:29:54 +0000 (21:29 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 31 Oct 2012 23:29:54 +0000 (21:29 -0200)
tools/modprobe.c

index b8a64153916ce1ed2d9ac8238168551f38c72bd4..d03bce655fa709b1a253f661d092120931d4b8c4 100644 (file)
@@ -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);