From d50645fc0a205892e4cb9db6a0a48dfb0173bc1f Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 29 Sep 2007 11:24:39 +0000 Subject: [PATCH] dispose of connection when server down (related to ITS#5127) --- libraries/libldap/result.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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: -- 2.39.5