From 2237cbb7f9bdadfee9913f32a71eccd73d57d27b Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 2 Jul 2010 00:16:08 -0500 Subject: Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199 https://bugzilla.redhat.com/show_bug.cgi?id=610119 Resolves: bug 610119 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199 Fix description: Catch possible NULL pointer in ids_sasl_check_bind(). --- ldap/servers/slapd/saslbind.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index 58703657..ecc935c2 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -966,11 +966,10 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) bind_target_entry = get_entry(pb, dn); if ( bind_target_entry == NULL ) { - break; + goto out; } if ( slapi_check_account_lock(pb, bind_target_entry, pwresponse_requested, 1, 1) == 1) { - slapi_entry_free(bind_target_entry); - break; + goto out; } } @@ -1003,10 +1002,6 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) int pwrc; pwrc = need_new_pw(pb, &t, bind_target_entry, pwresponse_requested); - if ( bind_target_entry != NULL ) { - slapi_entry_free(bind_target_entry); - bind_target_entry = NULL; - } switch (pwrc) { case 1: @@ -1081,6 +1076,8 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) slapi_entry_free(referral); if (be) slapi_be_Unlock(be); + if (bind_target_entry) + slapi_entry_free(bind_target_entry); LDAPDebug( LDAP_DEBUG_TRACE, "=> ids_sasl_check_bind\n", 0, 0, 0 ); -- cgit