From: Pierangelo Masarati Date: Sat, 29 Sep 2007 11:24:39 +0000 (+0000) Subject: dispose of connection when server down (related to ITS#5127) X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~585 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d50645fc0a205892e4cb9db6a0a48dfb0173bc1f;p=openldap dispose of connection when server down (related to ITS#5127) --- diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index deb76220e2..0a20a81811 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -558,6 +558,14 @@ nextresp3: if ( sock_errno() == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING; #endif ld->ld_errno = LDAP_SERVER_DOWN; +#ifdef LDAP_R_COMPILE + ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex ); +#endif + ldap_free_connection( ld, lc, 1, 0 ); +#ifdef LDAP_R_COMPILE + ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex ); +#endif + lc = *lcp = NULL; return -1; default: