Commit 1a3fd9f7 authored by Emily Backes's avatar Emily Backes Committed by Quanah Gibson-Mount
Browse files

ITS#7712 Fix lock ordering in libldap abandon

parent b9ce8460
...@@ -279,9 +279,14 @@ start_again:; ...@@ -279,9 +279,14 @@ start_again:;
if ( lr != NULL ) { if ( lr != NULL ) {
if ( sendabandon || lr->lr_status == LDAP_REQST_WRITING ) { if ( sendabandon || lr->lr_status == LDAP_REQST_WRITING ) {
/* release ld_req_mutex while grabbing ld_conn_mutex to
* prevent deadlock.
*/
LDAP_MUTEX_UNLOCK( &ld->ld_req_mutex );
LDAP_MUTEX_LOCK( &ld->ld_conn_mutex ); LDAP_MUTEX_LOCK( &ld->ld_conn_mutex );
ldap_free_connection( ld, lr->lr_conn, 0, 1 ); ldap_free_connection( ld, lr->lr_conn, 0, 1 );
LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex ); LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex );
LDAP_MUTEX_LOCK( &ld->ld_req_mutex );
} }
if ( origid == msgid ) { if ( origid == msgid ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment