diff options
author | Herb Lewis <herb@samba.org> | 2003-08-15 23:57:05 +0000 |
---|---|---|
committer | Herb Lewis <herb@samba.org> | 2003-08-15 23:57:05 +0000 |
commit | 4809559c6450d0768a6b03681098286e3d5294da (patch) | |
tree | 9131e96bcc62b9c0ceb92920ecbb8939e47544a7 /source4 | |
parent | a59229614ebeb17f3e4db2edcb70b71f7bf31982 (diff) | |
download | samba-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')
-rw-r--r-- | source4/libcli/cliconnect.c | 8 |
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); } |