summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/libsmb_server.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index 4dbc2652d2..755ef2d32b 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -246,7 +246,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
{
SMBCSRV *srv=NULL;
char *workgroup = NULL;
- struct cli_state *c;
+ struct cli_state *c = NULL;
const char *server_n = server;
int is_ipc = (share != NULL && strcmp(share, "IPC$") == 0);
uint32 fs_attrs = 0;
@@ -586,6 +586,10 @@ done:
workgroup = *pp_workgroup;
}
if(!workgroup) {
+ if (c != NULL) {
+ cli_shutdown(c);
+ }
+ SAFE_FREE(srv);
return NULL;
}