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>
Wed, 12 Oct 2011 01:49:05 +0000 (03:49 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
source3/utils/smbcacls.c

index bb7746e6b00bbf78c1d68453d88bc9608d9e943e..9a6c2836309e39401faae6e3e7bb3a7c056bb5f2 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_state_set_tid(cli, 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_state_set_tid(cli, orig_cnum);
        TALLOC_FREE(frame);
        return status;