\ITS#9996 librewrite plug potential leak in ldapmap map_ldap_apply()

This commit is contained in:
Howard Chu 2023-02-02 15:08:34 +00:00 committed by Quanah Gibson-Mount
parent 7f0e4ecdaa
commit d9507a834c

View file

@ -360,11 +360,13 @@ do_bind:;
data->lm_attrs, 0, NULL, NULL, NULL, 1, &res );
if ( rc == LDAP_SERVER_DOWN && first_try ) {
first_try = 0;
if ( ldap_initialize( &ld, data->lm_url ) != LDAP_SUCCESS ) {
if ( ldap_initialize( &ld, data->lm_url ) != LDAP_SUCCESS ) {
rc = REWRITE_ERR;
goto rc_return;
}
set_version = 1;
ldap_msgfree( res );
res = NULL;
goto do_bind;
} else if ( rc != LDAP_SUCCESS ) {
@ -373,7 +375,6 @@ do_bind:;
}
if ( ldap_count_entries( ld, res ) != 1 ) {
ldap_msgfree( res );
rc = REWRITE_ERR;
goto rc_return;
}
@ -408,14 +409,14 @@ do_bind:;
}
}
ldap_msgfree( res );
if ( val->bv_val == NULL ) {
rc = REWRITE_ERR;
goto rc_return;
}
rc_return:;
ldap_msgfree( res );
if ( data->lm_when == MAP_LDAP_EVERYTIME ) {
if ( ld != NULL ) {
ldap_unbind_ext( ld, NULL, NULL );