summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-03-05 16:28:43 +0100
committerGünther Deschner <gd@samba.org>2008-03-05 18:44:26 +0100
commit9d7cad7e8246b11c28096c2e62f6ef4e18f79722 (patch)
tree81803a2c6e41bf24e090c78513038bb422d17ade
parentd42e415b4069f293c28fd0cae7fe6fbaa587b171 (diff)
downloadsamba-9d7cad7e8246b11c28096c2e62f6ef4e18f79722.tar.gz
samba-9d7cad7e8246b11c28096c2e62f6ef4e18f79722.tar.bz2
samba-9d7cad7e8246b11c28096c2e62f6ef4e18f79722.zip
Fix a memleak -- Coverity ID 222
(cherry picked from commit a40781bafa3a8f0c7737164bca6cf74b0a452e72) (This used to be commit 86cabcad74ac06d888f2a352a2bef3abea1ed85c)
-rw-r--r--source3/passdb/pdb_ldap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 87a648a5b4..dec9b5bafb 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -349,6 +349,7 @@ int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state,
filter = talloc_asprintf(talloc_tos(), "(&%s%s)", "(uid=%u)",
get_objclass_filter(ldap_state->schema_ver));
if (!filter) {
+ SAFE_FREE(escape_user);
return LDAP_NO_MEMORY;
}
/*
@@ -358,10 +359,10 @@ int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state,
filter = talloc_all_string_sub(talloc_tos(),
filter, "%u", escape_user);
+ SAFE_FREE(escape_user);
if (!filter) {
return LDAP_NO_MEMORY;
}
- SAFE_FREE(escape_user);
ret = smbldap_search_suffix(ldap_state->smbldap_state,
filter, attr, result);