summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-06-07 08:48:13 +0200
committerVolker Lendecke <vl@samba.org>2008-06-07 08:48:13 +0200
commit32452565be35ef517356ba7ac10e54e65319c829 (patch)
tree738efa3d6c6a19d46012e1591433f311565f9994 /source3/passdb
parentdd30dd2a14f4a883d737150de80d896b941180c5 (diff)
downloadsamba-32452565be35ef517356ba7ac10e54e65319c829.tar.gz
samba-32452565be35ef517356ba7ac10e54e65319c829.tar.bz2
samba-32452565be35ef517356ba7ac10e54e65319c829.zip
Fix a memleak in fetch_ldap_pw
Fix Coverity ID 572, also fix the error check for secrets_fetch failing (This used to be commit 2663c81a782fd4394a9feaaaa987c7f6d38ca5da)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/secrets.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index a7223b7e9f..d6a0e89bba 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -884,10 +884,11 @@ bool fetch_ldap_pw(char **dn, char** pw)
if (*p == ',') *p = '/';
data=(char *)secrets_fetch(old_style_key, &size);
- if (!size && size < sizeof(old_style_pw)) {
+ if ((data == NULL) || (size < sizeof(old_style_pw))) {
DEBUG(0,("fetch_ldap_pw: neither ldap secret retrieved!\n"));
SAFE_FREE(old_style_key);
SAFE_FREE(*dn);
+ SAFE_FREE(data);
return False;
}