From: Hallvard Furuseth Date: Tue, 14 Dec 2010 13:35:42 +0000 (+0000) Subject: ITS#6746: Preserve error code, plug entry leak X-Git-Tag: MIGRATION_CVS2GIT~362 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0aa8c028b389b3463f1566a3da69fb68008cec34;p=openldap ITS#6746: Preserve error code, plug entry leak --- diff --git a/servers/slapd/overlays/translucent.c b/servers/slapd/overlays/translucent.c index 03e807c891..d6ac0691a0 100644 --- a/servers/slapd/overlays/translucent.c +++ b/servers/slapd/overlays/translucent.c @@ -1160,11 +1160,11 @@ static int translucent_search(Operation *op, SlapReply *rs) { av = tavl_end( tc.list, TAVL_DIR_LEFT ); while ( av ) { rs->sr_entry = av->avl_data; - rc = test_filter( op, rs->sr_entry, op->ors_filter ); - if ( rc == LDAP_COMPARE_TRUE ) { + if ( rc == LDAP_SUCCESS && LDAP_COMPARE_TRUE == + test_filter( op, rs->sr_entry, op->ors_filter )) + { rs->sr_flags = REP_ENTRY_MUSTBEFREED; rc = send_search_entry( op, rs ); - if ( rc ) break; } else { entry_free( rs->sr_entry ); }