From e721e6bec99fe4f9017c6e9d7299173b4fce733e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 27 Nov 2002 03:57:36 +0000 Subject: [PATCH] Fix ITS#2187, recursively free all requests --- libraries/libldap/request.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 ); }