From: Howard Chu Date: Wed, 27 Nov 2002 03:57:36 +0000 (+0000) Subject: Fix ITS#2187, recursively free all requests X-Git-Tag: NO_SLAP_OP_BLOCKS~765 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e721e6bec99fe4f9017c6e9d7299173b4fce733e;p=openldap Fix ITS#2187, recursively free all requests --- diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index b1ed8dba4a..66c5b67524 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -649,15 +649,15 @@ ldap_free_request( LDAP *ld, LDAPRequest *lr ) lr->lr_origid, lr->lr_msgid, 0 ); #endif + /* free all referrals (child requests) */ + while ( lr->lr_child ) + ldap_free_request( ld, lr->lr_child ); + if ( lr->lr_parent != NULL ) { --lr->lr_parent->lr_outrefcnt; for ( ttmplr = &lr->lr_parent->lr_child; *ttmplr && *ttmplr != lr; ttmplr = &(*ttmplr)->lr_refnext ); if ( *ttmplr == lr ) *ttmplr = lr->lr_refnext; - } else { - /* free all referrals (child requests) */ - while ( lr->lr_child ) - ldap_free_request( ld, lr->lr_child ); } ldap_free_request_int( ld, lr ); }