]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
referral tweaks
authorKurt Zeilenga <kurt@openldap.org>
Wed, 27 Nov 2002 19:33:47 +0000 (19:33 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 27 Nov 2002 19:33:47 +0000 (19:33 +0000)
libraries/libldap/request.c

index b1ed8dba4a343e9b69b14bce51e9ff83a1f0c78a..66c5b675241d3f6ef378f11a688c0c4c2cab03da 100644 (file)
@@ -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 );
 }