]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbtree: Add "fail:" target, more failure paths with follow
authorVolker Lendecke <vl@samba.org>
Sat, 11 Apr 2020 17:03:39 +0000 (19:03 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 18 Apr 2020 02:29:34 +0000 (02:29 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/smbtree.c

index e352bccb04d4b3b34d8f224735a014dbf230216c..847171ffef10d2a96197623badef3b4f27dbba53 100644 (file)
@@ -371,6 +371,8 @@ int main(int argc, char *argv[])
                POPT_TABLEEND
        };
        poptContext pc;
+       int result = 1;
+
 
        /* Initialise samba stuff */
        smb_init_locale();
@@ -389,13 +391,14 @@ int main(int argc, char *argv[])
        /* Now do our stuff */
 
         if (!print_tree(popt_get_cmdline_auth_info())) {
-               poptFreeContext(pc);
-               TALLOC_FREE(frame);
-                return 1;
+               goto fail;
        }
 
        popt_free_cmdline_auth_info();
+
+       result = 0;
+fail:
        poptFreeContext(pc);
        TALLOC_FREE(frame);
-       return 0;
+       return result;
 }