diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 11d5e594f3..90e9e69b65 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -268,6 +268,7 @@ try_read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, #endif /* get the next message */ + errno = 0; if ( (tag = ber_get_next( sb, &len, ber )) != LDAP_TAG_MESSAGE ) { if ( tag == LBER_DEFAULT) {