diff options
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_use.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_use.c b/source3/rpc_client/cli_use.c index 99cdb129f7..69e46c081b 100644 --- a/source3/rpc_client/cli_use.c +++ b/source3/rpc_client/cli_use.c @@ -43,9 +43,15 @@ terminate client connection ****************************************************************************/ static void cli_use_free(struct cli_use *cli) { - cli_ulogoff(cli->cli); - cli_shutdown(cli->cli); - free(cli->cli); + if (cli->cli != NULL) + { + if (cli->cli->initialised) + { + cli_ulogoff(cli->cli); + cli_shutdown(cli->cli); + } + free(cli->cli); + } free(cli); } |