summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}