summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2003-08-15 23:57:05 +0000
committerHerb Lewis <herb@samba.org>2003-08-15 23:57:05 +0000
commit4809559c6450d0768a6b03681098286e3d5294da (patch)
tree9131e96bcc62b9c0ceb92920ecbb8939e47544a7 /source4/libcli
parenta59229614ebeb17f3e4db2edcb70b71f7bf31982 (diff)
downloadsamba-4809559c6450d0768a6b03681098286e3d5294da.tar.gz
samba-4809559c6450d0768a6b03681098286e3d5294da.tar.bz2
samba-4809559c6450d0768a6b03681098286e3d5294da.zip
don't leak memory if cli->tree is NULL
(This used to be commit b034c4b86e2faddf0928810a3e56c03d6aaef9f5)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/cliconnect.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c
index ea5f4e8a5d..4fdffa6287 100644
--- a/source4/libcli/cliconnect.c
+++ b/source4/libcli/cliconnect.c
@@ -211,9 +211,11 @@ struct cli_state *cli_state_init(void)
****************************************************************************/
void cli_shutdown(struct cli_state *cli)
{
- if (!cli || !cli->tree) return;
- cli->tree->reference_count++;
- cli_tree_close(cli->tree);
+ if (!cli) return;
+ if (cli->tree) {
+ cli->tree->reference_count++;
+ cli_tree_close(cli->tree);
+ }
if (cli->mem_ctx) {
talloc_destroy(cli->mem_ctx);
}