summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-06-19 19:23:47 +0200
committerVolker Lendecke <vl@samba.org>2011-06-19 19:36:27 +0200
commit9cc68e49ee0744ecd64f12fc0f0c54e89bc6773c (patch)
tree7b4e8f81e3d3cefa9bd89047b20a49803467afbe /source3/libsmb
parent59887edd1d8ea1baefa3c884a80eafdb9691f095 (diff)
downloadsamba-9cc68e49ee0744ecd64f12fc0f0c54e89bc6773c.tar.gz
samba-9cc68e49ee0744ecd64f12fc0f0c54e89bc6773c.tar.bz2
samba-9cc68e49ee0744ecd64f12fc0f0c54e89bc6773c.zip
s3: Fix Coverity ID 2583: RESOURCE_LEAK
Diffstat (limited to 'source3/libsmb')
-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;
}