--- libraries/libldap/result.c 2001/07/21 21:13:06 1.57 +++ libraries/libldap/result.c 2001/09/24 16:50:44 1.58 @@ -1,4 +1,4 @@ -/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.56 2001/03/15 02:11:52 kurt Exp $ */ +/* $OpenLDAP: pkg/ldap/libraries/libldap/result.c,v 1.57 2001/07/21 21:13:06 kurt Exp $ */ /* * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file @@ -598,9 +598,12 @@ Debug( LDAP_DEBUG_TRACE, } /* Check if all requests are finished, lr is now parent */ - for(tmplr=lr ; tmplr != NULL; tmplr=tmplr->lr_refnext) { + tmplr = lr; + if (tmplr->lr_status == LDAP_REQST_COMPLETED) { + for(tmplr=lr->lr_child; tmplr != NULL; tmplr=tmplr->lr_refnext) { if( tmplr->lr_status != LDAP_REQST_COMPLETED) { break; + } } }