summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
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);
}