X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fresult.c;h=19d162ed53069f2367fbd57b512facd5a43ace37;hb=c9de09b1d016de2a34069d5b1d019b6bfb07510c;hp=4871d23ced86e48b139365bf4f4bf1e9807a1684;hpb=fb973c2dae0827387d63aeaace2674d66414a6a6;p=openldap diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 4871d23ced..19d162ed53 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -79,6 +79,7 @@ send_ldap_result2( if ( rc == -1 ) { Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); + ber_free( ber, 1 ); return; } @@ -89,7 +90,7 @@ send_ldap_result2( bytes = ber->ber_ptr - ber->ber_buf; ldap_pvt_thread_mutex_lock( &new_conn_mutex ); while ( conn->c_connid == op->o_connid && ber_flush( &conn->c_sb, ber, - 1 ) != 0 ) { + 0 ) != 0 ) { ldap_pvt_thread_mutex_unlock( &new_conn_mutex ); /* * we got an error. if it's ewouldblock, we need to @@ -105,6 +106,7 @@ send_ldap_result2( close_connection( conn, op->o_connid, op->o_opid ); ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex ); + ber_free( ber, 1 ); return; } @@ -128,6 +130,8 @@ send_ldap_result2( ldap_pvt_thread_mutex_unlock( &new_conn_mutex ); ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex ); + ber_free( ber, 1 ); + ldap_pvt_thread_mutex_lock( &num_sent_mutex ); num_bytes_sent += bytes; ldap_pvt_thread_mutex_unlock( &num_sent_mutex ); @@ -327,7 +331,7 @@ send_search_entry( bytes = ber->ber_ptr - ber->ber_buf; ldap_pvt_thread_mutex_lock( &new_conn_mutex ); while ( conn->c_connid == op->o_connid && ber_flush( &conn->c_sb, ber, - 1 ) != 0 ) { + 0 ) != 0 ) { ldap_pvt_thread_mutex_unlock( &new_conn_mutex ); /* * we got an error. if it's ewouldblock, we need to @@ -343,6 +347,7 @@ send_search_entry( close_connection( conn, op->o_connid, op->o_opid ); ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex ); + ber_free( ber, 1 ); return( -1 ); } @@ -364,6 +369,8 @@ send_search_entry( ldap_pvt_thread_mutex_unlock( &new_conn_mutex ); ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex ); + ber_free( ber, 1 ); + ldap_pvt_thread_mutex_lock( &num_sent_mutex ); num_bytes_sent += bytes; num_entries_sent++;