lookup_ldap.c: set result pointer to NULL when search fails
PATCH 1/1 lookup_ldap.c: set result pointer to NULL when search fails
Hi, Ian,
It looks like we could end up with a result pointer that is non-null from a failed call to ldap_search_s. At least, in my brief look at the library code it looks like this *might* happen. So, to be safe, let's check for that.
Cheers,
Jeff
Signed-off-by Jeff Moyer <[email protected]>
modules/lookup_ldap.c +4 -0
@@ -390,6 +390,10 @@ static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxterror (logopt,MODPREFIX "query failed for search dn %s: %s" , this->basedn,ldap_err2string (rv)); +if (result) { +ldap_msgfree (result); + result =NULL ; + } } this = this->next;