Do not compare c_auth when NULL

This commit is contained in:
Ondřej Kuzník 2018-01-16 17:32:37 +00:00 committed by Ondřej Kuzník
parent ee893ae147
commit 72ca711271

View File

@ -471,12 +471,14 @@ handle_bind_response(
client->c_state = LLOAD_C_READY; client->c_state = LLOAD_C_READY;
client->c_type = LLOAD_C_OPEN; client->c_type = LLOAD_C_OPEN;
client->c_pin_id = 0; client->c_pin_id = 0;
if ( result != LDAP_SUCCESS ) { if ( !BER_BVISNULL( &client->c_auth ) ) {
ber_memfree( client->c_auth.bv_val ); if ( result != LDAP_SUCCESS ) {
BER_BVZERO( &client->c_auth ); ber_memfree( client->c_auth.bv_val );
} else if ( !ber_bvstrcasecmp( BER_BVZERO( &client->c_auth );
&client->c_auth, &lloadd_identity ) ) { } else if ( !ber_bvstrcasecmp(
client->c_type = LLOAD_C_PRIVILEGED; &client->c_auth, &lloadd_identity ) ) {
client->c_type = LLOAD_C_PRIVILEGED;
}
} }
if ( !BER_BVISNULL( &client->c_sasl_bind_mech ) ) { if ( !BER_BVISNULL( &client->c_sasl_bind_mech ) ) {
ber_memfree( client->c_sasl_bind_mech.bv_val ); ber_memfree( client->c_sasl_bind_mech.bv_val );