s3:smbcacls fix leaking talloc stackframce on tcon failure
authorGregor Beck <gbeck@sernet.de>
Tue, 14 Jun 2011 11:19:59 +0000 (13:19 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 23 Aug 2011 12:34:31 +0000 (14:34 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
source3/utils/smbcacls.c

index 99018eefafedfba6d32c742588200f4db6be9254..269f3133524678dbaf2a9bba8fb2af42c5e2ab7f 100644 (file)
@@ -91,7 +91,7 @@ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli,
 
        status = cli_tcon_andx(cli, "IPC$", "?????", "", 0);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               goto tcon_fail;
        }
 
        status = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
@@ -120,6 +120,7 @@ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli,
  fail:
        TALLOC_FREE(p);
        cli_tdis(cli);
+ tcon_fail:
        cli->cnum = orig_cnum;
        TALLOC_FREE(frame);
        return status;
@@ -140,7 +141,7 @@ static NTSTATUS cli_lsa_lookup_name(struct cli_state *cli,
 
        status = cli_tcon_andx(cli, "IPC$", "?????", "", 0);
        if (!NT_STATUS_IS_OK(status)) {
-               return status;
+               goto tcon_fail;
        }
 
        status = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
@@ -168,6 +169,7 @@ static NTSTATUS cli_lsa_lookup_name(struct cli_state *cli,
  fail:
        TALLOC_FREE(p);
        cli_tdis(cli);
+ tcon_fail:
        cli->cnum = orig_cnum;
        TALLOC_FREE(frame);
        return status;