ITS#9305 libldap: don't mask ld_errno if set during connect failure

This commit is contained in:
Howard Chu 2025-12-05 10:33:13 +00:00 committed by Quanah Gibson-Mount
parent b0e95d023a
commit 148e940fda
2 changed files with 4 additions and 2 deletions

View file

@ -43,7 +43,8 @@ int ldap_open_defconn( LDAP *ld )
&ld->ld_options.ldo_defludp, 1, 1, NULL, 0, 0 );
if( ld->ld_defconn == NULL ) {
ld->ld_errno = LDAP_SERVER_DOWN;
if ( !ld->ld_errno )
ld->ld_errno = LDAP_SERVER_DOWN;
return -1;
}

View file

@ -509,7 +509,8 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb,
ber_sockbuf_free( lc->lconn_sb );
}
LDAP_FREE( (char *)lc );
ld->ld_errno = LDAP_SERVER_DOWN;
if ( !ld->ld_errno )
ld->ld_errno = LDAP_SERVER_DOWN;
return( NULL );
}