From 72ca7112717f5868284b785872adbe4e068f38a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Tue, 16 Jan 2018 17:32:37 +0000 Subject: [PATCH] Do not compare c_auth when NULL --- servers/lloadd/bind.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/servers/lloadd/bind.c b/servers/lloadd/bind.c index 73284f4941..4f1b15c1c6 100644 --- a/servers/lloadd/bind.c +++ b/servers/lloadd/bind.c @@ -471,12 +471,14 @@ handle_bind_response( client->c_state = LLOAD_C_READY; client->c_type = LLOAD_C_OPEN; client->c_pin_id = 0; - if ( result != LDAP_SUCCESS ) { - ber_memfree( client->c_auth.bv_val ); - BER_BVZERO( &client->c_auth ); - } else if ( !ber_bvstrcasecmp( - &client->c_auth, &lloadd_identity ) ) { - client->c_type = LLOAD_C_PRIVILEGED; + if ( !BER_BVISNULL( &client->c_auth ) ) { + if ( result != LDAP_SUCCESS ) { + ber_memfree( client->c_auth.bv_val ); + BER_BVZERO( &client->c_auth ); + } else if ( !ber_bvstrcasecmp( + &client->c_auth, &lloadd_identity ) ) { + client->c_type = LLOAD_C_PRIVILEGED; + } } if ( !BER_BVISNULL( &client->c_sasl_bind_mech ) ) { ber_memfree( client->c_sasl_bind_mech.bv_val );