]> git.sur5r.net Git - openldap/commitdiff
ITS#8585 Fail ldap_result if handle is already bad
authorHoward Chu <hyc@symas.com>
Tue, 7 Feb 2017 12:56:35 +0000 (12:56 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 7 Feb 2017 13:00:05 +0000 (13:00 +0000)
libraries/libldap/result.c

index dd3b2b642653fd26429fdd67543db3ea98ef9516..fba8ff4397ab020adc3927325c6816a716ed4d9f 100644 (file)
@@ -113,6 +113,9 @@ ldap_result(
 
        Debug( LDAP_DEBUG_TRACE, "ldap_result ld %p msgid %d\n", (void *)ld, msgid, 0 );
 
+       if (ld->ld_errno == LDAP_LOCAL_ERROR || ld->ld_errno == LDAP_SERVER_DOWN)
+               return -1;
+
        LDAP_MUTEX_LOCK( &ld->ld_res_mutex );
        rc = wait4msg( ld, msgid, all, timeout, result );
        LDAP_MUTEX_UNLOCK( &ld->ld_res_mutex );