summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-03-12 10:57:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:19 -0500
commit21db43ab55ff80a7c0fd208deedfb7320cfea20e (patch)
treeafb2bc10570e45d03fc37fd9914f47e25f1a249a /source3
parent2e42254291db98ebb29b987ec7ee0ce5ac20df88 (diff)
downloadsamba-21db43ab55ff80a7c0fd208deedfb7320cfea20e.tar.gz
samba-21db43ab55ff80a7c0fd208deedfb7320cfea20e.tar.bz2
samba-21db43ab55ff80a7c0fd208deedfb7320cfea20e.zip
r14235: Fix Coverity bug # 91
(This used to be commit 26d471c02c6ddff15836a3c0d30f9e37f018b66d)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/libsmbclient.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index a18e9910aa..75b2b37c06 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -2594,6 +2594,10 @@ smbc_opendir_ctx(SMBCCTX *context,
if (!find_master_ip(workgroup, &server_addr.ip)) {
+ if (dir) {
+ SAFE_FREE(dir->fname);
+ SAFE_FREE(dir);
+ }
errno = ENOENT;
return NULL;
}
@@ -2705,6 +2709,10 @@ smbc_opendir_ctx(SMBCCTX *context,
DEBUG(0, ("Could not get name of "
"local/domain master browser "
"for server %s\n", server));
+ if (dir) {
+ SAFE_FREE(dir->fname);
+ SAFE_FREE(dir);
+ }
errno = EPERM;
return NULL;
@@ -2828,6 +2836,10 @@ smbc_opendir_ctx(SMBCCTX *context,
&targetcli, targetpath))
{
d_printf("Could not resolve %s\n", path);
+ if (dir) {
+ SAFE_FREE(dir->fname);
+ SAFE_FREE(dir);
+ }
return NULL;
}