diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index d8d601e814..dd270374fd 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -723,9 +723,9 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, async); if ( (rc == 0) || (rc == -2) ) { - i = ldap_int_connect_cbs( ld, sb, &s, srv, (struct sockaddr *)&sin ); - if ( i ) - rc = i; + int err = ldap_int_connect_cbs( ld, sb, &s, srv, (struct sockaddr *)&sin ); + if ( err ) + rc = err; else break; }