diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index f5a5868860..b390f55d57 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -196,11 +196,13 @@ chkResponseList( tmp = NULL; } - if ( tmp == NULL ) { + if ( tmp == NULL && msgid != LDAP_RES_ANY ) { lm = NULL; } - break; + if ( tmp || msgid != LDAP_RES_ANY ) { + break; + } } lastlm = &lm->lm_next; }