ITS#9997 syncrepl: plug potential leak in changelog search

Note this is only used with changelog, which is nonstandard and obsolete.
This commit is contained in:
Howard Chu 2023-02-02 15:12:55 +00:00 committed by Quanah Gibson-Mount
parent d9507a834c
commit 4a9e449b24

View file

@ -604,8 +604,10 @@ ldap_sync_search(
lattrs[2] = NULL; lattrs[2] = NULL;
rc = ldap_search_ext_s( si->si_ld, "", LDAP_SCOPE_BASE, generic_filterstr.bv_val, lattrs, 0, rc = ldap_search_ext_s( si->si_ld, "", LDAP_SCOPE_BASE, generic_filterstr.bv_val, lattrs, 0,
NULL, NULL, NULL, si->si_slimit, &res ); NULL, NULL, NULL, si->si_slimit, &res );
if ( rc ) if ( rc ) {
ldap_msgfree( res );
return rc; return rc;
}
msg = ldap_first_message( si->si_ld, res ); msg = ldap_first_message( si->si_ld, res );
if ( msg && ldap_msgtype( msg ) == LDAP_RES_SEARCH_ENTRY ) { if ( msg && ldap_msgtype( msg ) == LDAP_RES_SEARCH_ENTRY ) {
BerElement *ber = NULL; BerElement *ber = NULL;