summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/passdb/pdb_ldap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 74ed907a87..0bf051eecd 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -4070,6 +4070,9 @@ static BOOL ldapgroup2displayentry(struct ldap_search_state *state,
vals = ldap_get_values(ld, entry, "sambaGroupType");
if ((vals == NULL) || (vals[0] == NULL)) {
DEBUG(5, ("\"sambaGroupType\" not found\n"));
+ if (vals != NULL) {
+ ldap_value_free(vals);
+ }
return False;
}
@@ -4077,9 +4080,12 @@ static BOOL ldapgroup2displayentry(struct ldap_search_state *state,
if ((state->group_type != 0) &&
((state->group_type != group_type))) {
+ ldap_value_free(vals);
return False;
}
+ ldap_value_free(vals);
+
/* display name is the NT group name */
vals = ldap_get_values(ld, entry, "displayName");
@@ -4119,6 +4125,9 @@ static BOOL ldapgroup2displayentry(struct ldap_search_state *state,
vals = ldap_get_values(ld, entry, "sambaSid");
if ((vals == NULL) || (vals[0] == NULL)) {
DEBUG(0, ("\"objectSid\" not found\n"));
+ if (vals != NULL) {
+ ldap_value_free(vals);
+ }
return False;
}