]> git.sur5r.net Git - openldap/commitdiff
plug leak/logical error (ITS#6326)
authorPierangelo Masarati <ando@openldap.org>
Wed, 7 Oct 2009 22:46:35 +0000 (22:46 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 7 Oct 2009 22:46:35 +0000 (22:46 +0000)
servers/slapd/back-ldap/search.c

index c7458285016c94470e2e168ae306e56778d6f452..c8ccbed0ec2585e074eedde63dd5d80007983a3b 100644 (file)
@@ -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;
                        }