* filter variable being NULL results in error condition returned before
the filter is used. No need to test and use a hard-coded backup filter.
* ber variable is freed in the master loop and is not skipped. The loop
only exists when ent is NULL. Neither needs to be freed.
Detected by Coverity Scan. Issues 740339, 740340, 740341
if (l->lm != NULL)
ldap_msgfree(l->lm); /* Make sure l->lm is empty */
- if (filter == NULL) /* if filter is NULL, then return ALL networkAddress */
- xstrncpy(ft, "(&(objectClass=User)(networkAddress=*))", sizeof(ft));
- else
- xstrncpy(ft, filter, sizeof(ft));
+ xstrncpy(ft, filter, sizeof(ft));
/* We have a binded connection, with a free l->lm, so let's get this done */
switch (scope) {
ldap_value_free_len(l->val);
l->val = NULL;
}
- if (ber != NULL) {
- ldap_value_free_len(ber);
- ber = NULL;
- }
- if (ent != NULL) {
- ldap_msgfree(ent);
- ent = NULL;
- }
if (l->lm != NULL) {
ldap_msgfree(l->lm);
l->lm = NULL;