clitar.c: fix segfault in cmd_block()
authorAurélien Aptel <aurelien.aptel@gmail.com>
Wed, 7 Aug 2013 14:49:20 +0000 (16:49 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 19 Feb 2014 17:22:29 +0000 (18:22 +0100)
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/client/clitar.c

index 1e2b4f0840a9d5791e4d67533418197f350822b0..e0c9c94d3354e6fd33e234a6964b974f40ccbf45 100644 (file)
@@ -250,14 +250,18 @@ int cmd_block(void)
     if (!next_token_talloc(ctx, &cmd_ptr, &buf, NULL)) {
         DBG(0, ("blocksize <n>\n"));
         err = 1;
+        goto out;
     }
 
     if (tar_set_blocksize(&tar_ctx, atoi(buf))) {
         DBG(0, ("invalid blocksize\n"));
         err = 1;
+        goto out;
     }
 
     DBG(2, ("blocksize is now %d\n", tar_ctx.mode.blocksize));
+
+ out:
     talloc_free(ctx);
     return err;
 }