diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-29 13:24:54 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-29 13:24:54 -0800 |
commit | d2cf97aeba14a4d336fb57b01f19bd5a08dcb003 (patch) | |
tree | 659f15d8011a1a110850c01e11078eae86d8bdad /source3/winbindd | |
parent | 42c87fe6e6036a56b178183b034275321949050d (diff) | |
download | samba-d2cf97aeba14a4d336fb57b01f19bd5a08dcb003.tar.gz samba-d2cf97aeba14a4d336fb57b01f19bd5a08dcb003.tar.bz2 samba-d2cf97aeba14a4d336fb57b01f19bd5a08dcb003.zip |
Remove the explicit TALLOC_CTX * from cli_struct.
Make us very explicit about how long a talloc ctx
should last.
Jeremy.
(This used to be commit ba9e2be2b5a59684e854609f9d82ea1633448c62)
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd_cm.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index f8e76b0299..7da7a82343 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -1744,6 +1744,13 @@ static void set_dc_type_and_flags_connect( struct winbindd_domain *domain ) return; } + mem_ctx = talloc_init("set_dc_type_and_flags on domain %s\n", + domain->name); + if (!mem_ctx) { + DEBUG(1, ("set_dc_type_and_flags_connect: talloc_init() failed\n")); + return; + } + DEBUG(5, ("set_dc_type_and_flags_connect: domain %s\n", domain->name )); cli = cli_rpc_pipe_open_noauth(domain->conn.cli, PI_LSARPC_DS, @@ -1761,7 +1768,7 @@ static void set_dc_type_and_flags_connect( struct winbindd_domain *domain ) goto no_lsarpc_ds; } - result = rpccli_ds_getprimarydominfo(cli, cli->cli->mem_ctx, + result = rpccli_ds_getprimarydominfo(cli, mem_ctx, DsRolePrimaryDomainInfoBasic, &ctr); cli_rpc_pipe_close(cli); @@ -1780,6 +1787,7 @@ static void set_dc_type_and_flags_connect( struct winbindd_domain *domain ) goto no_lsarpc_ds; } + TALLOC_FREE(mem_ctx); return; } @@ -1798,14 +1806,7 @@ no_lsarpc_ds: "PI_LSARPC on domain %s: (%s)\n", domain->name, nt_errstr(result))); cli_rpc_pipe_close(cli); - return; - } - - mem_ctx = talloc_init("set_dc_type_and_flags on domain %s\n", - domain->name); - if (!mem_ctx) { - DEBUG(1, ("set_dc_type_and_flags_connect: talloc_init() failed\n")); - cli_rpc_pipe_close(cli); + TALLOC_FREE(mem_ctx); return; } @@ -1866,8 +1867,8 @@ done: domain->name, domain->active_directory ? "" : "NOT ")); cli_rpc_pipe_close(cli); - - talloc_destroy(mem_ctx); + + TALLOC_FREE(mem_ctx); domain->initialized = True; } |