]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/result.c
ITS#6254
[openldap] / libraries / libldap / result.c
index 21f02c9831b338b862801ebcefabc736352b0ee9..afdc236ea7eb2d20e624f4bacddb86696e01c960 100644 (file)
@@ -106,7 +106,6 @@ ldap_result(
        struct timeval *timeout,
        LDAPMessage **result )
 {
-       LDAPMessage     *lm;
        int             rc;
 
        assert( ld != NULL );
@@ -846,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 ) {
@@ -1384,7 +1387,6 @@ ldap_abandoned( LDAP *ld, ber_int_t msgid, int *idxp )
 
        assert( idxp != NULL );
        assert( msgid >= 0 );
-       assert( ld->ld_nabandoned >= 0 );
 
        return ldap_int_bisect_find( ld->ld_abandoned, ld->ld_nabandoned, msgid, idxp );
 }