summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-11-19 11:59:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:22 -0500
commitb917dd4bfa9082e3447ee8e38e52c402d602793e (patch)
tree6feb2dbfbddf65f659ddc8ca0ddb7b1284a00be3 /source3/passdb
parentaa077290fc3792d18c2fbe052985aaeb1200683b (diff)
downloadsamba-b917dd4bfa9082e3447ee8e38e52c402d602793e.tar.gz
samba-b917dd4bfa9082e3447ee8e38e52c402d602793e.tar.bz2
samba-b917dd4bfa9082e3447ee8e38e52c402d602793e.zip
r3871: Fix memleak
(This used to be commit dbfdde5f63f34fbe4ba1d794fcfc120178ff039a)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 685d393eb9..151fbd6b16 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -2210,7 +2210,7 @@ static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods,
struct smbldap_state *conn = ldap_state->smbldap_state;
pstring filter;
char *attrs[] = { "gidNumber", "sambaSID", NULL };
- char *escape_name = escape_ldap_string_alloc(username);
+ char *escape_name;
int rc;
LDAPMessage *msg = NULL;
LDAPMessage *entry;
@@ -2226,6 +2226,8 @@ static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods,
*sids = NULL;
num_sids = 0;
+ escape_name = escape_ldap_string_alloc(username);
+
if (escape_name == NULL)
return NT_STATUS_UNSUCCESSFUL;