diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-03-22 15:07:10 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2013-08-05 10:30:01 +0200 |
commit | d54c908ff5bef774f5cca038741558089ff6baeb (patch) | |
tree | 408fefd72987c5c3eb09159305033ed7c394d5cd /source3/rpcclient | |
parent | 34fa7946993506fde2c6b30e4a41bea27390a814 (diff) | |
download | samba-d54c908ff5bef774f5cca038741558089ff6baeb.tar.gz samba-d54c908ff5bef774f5cca038741558089ff6baeb.tar.bz2 samba-d54c908ff5bef774f5cca038741558089ff6baeb.zip |
s3:rpcclient: use talloc_stackframe() in do_cmd()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/rpcclient.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index c23ff2df25..9bf296ecc5 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -678,7 +678,7 @@ static NTSTATUS do_cmd(struct cli_state *cli, /* Create mem_ctx */ - if (!(mem_ctx = talloc_init("do_cmd"))) { + if (!(mem_ctx = talloc_stackframe())) { DEBUG(0, ("talloc_init() failed\n")); return NT_STATUS_NO_MEMORY; } @@ -745,12 +745,14 @@ static NTSTATUS do_cmd(struct cli_state *cli, "auth type %u\n", cmd_entry->table->name, pipe_default_auth_type )); + talloc_free(mem_ctx); return NT_STATUS_UNSUCCESSFUL; } if (!NT_STATUS_IS_OK(ntresult)) { DEBUG(0, ("Could not initialise %s. Error was %s\n", cmd_entry->table->name, nt_errstr(ntresult) )); + talloc_free(mem_ctx); return ntresult; } @@ -765,6 +767,7 @@ static NTSTATUS do_cmd(struct cli_state *cli, trust_password, &machine_account, &sec_channel_type)) { + talloc_free(mem_ctx); return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; } @@ -780,6 +783,7 @@ static NTSTATUS do_cmd(struct cli_state *cli, if (!NT_STATUS_IS_OK(ntresult)) { DEBUG(0, ("Could not initialise credentials for %s.\n", cmd_entry->table->name)); + talloc_free(mem_ctx); return ntresult; } } @@ -803,7 +807,7 @@ static NTSTATUS do_cmd(struct cli_state *cli, /* Cleanup */ - talloc_destroy(mem_ctx); + talloc_free(mem_ctx); return ntresult; } |