if ( rc == -1 ) {
Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 );
+ ber_free( ber, 1 );
return;
}
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
close_connection( conn, op->o_connid, op->o_opid );
ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
+ ber_free( ber, 1 );
return;
}
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 );
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
close_connection( conn, op->o_connid, op->o_opid );
ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex );
+ ber_free( ber, 1 );
return( -1 );
}
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++;