]> git.sur5r.net Git - openldap/commitdiff
ITS#5980 clear res_matched after successfully chasing referral
authorHoward Chu <hyc@openldap.org>
Tue, 3 Mar 2009 17:57:24 +0000 (17:57 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 3 Mar 2009 17:57:24 +0000 (17:57 +0000)
libraries/libldap/result.c

index ad62a02d30749e00d16a9dcd38f86825ad630ca3..afdc236ea7eb2d20e624f4bacddb86696e01c960 100644 (file)
@@ -845,6 +845,10 @@ nextresp2:
                                return( -1 );   /* fatal error */
                        }
                        lr->lr_res_errno = LDAP_SUCCESS; /* sucessfully chased referral */
+                       if ( lr->lr_res_matched ) {
+                               LDAP_FREE( lr->lr_res_matched );
+                               lr->lr_res_matched = NULL;
+                       }
 
                } else {
                        if ( lr->lr_outrefcnt <= 0 && lr->lr_parent == NULL ) {