From 5118f06b13ed2dc3193722ccd261ce7ef157a532 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 7 Oct 2009 22:46:35 +0000 Subject: [PATCH] plug leak/logical error (ITS#6326) --- servers/slapd/back-ldap/search.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index c745828501..c8ccbed0ec 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -759,6 +759,7 @@ ldap_build_entry( ( oc = oc_bvfind_undef( &attr->a_vals[i] ) ) != NULL ) { ber_dupbv( &pval, &oc->soc_cname ); + rc = LDAP_SUCCESS; } else { LBER_FREE( attr->a_vals[i].bv_val ); @@ -770,8 +771,9 @@ ldap_build_entry( BER_BVZERO( &attr->a_vals[last] ); i--; } + } - } else if ( pretty ) { + if ( rc == LDAP_SUCCESS && pretty ) { LBER_FREE( attr->a_vals[i].bv_val ); attr->a_vals[i] = pval; } -- 2.39.5