From: Howard Chu Date: Sat, 18 Oct 2003 05:49:58 +0000 (+0000) Subject: ITS#2771 fix memory usage in LDAPDN_rewrite, fix normalizer X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~554 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dee604c6083015262f0442097ad6514b67bc2db7;p=openldap ITS#2771 fix memory usage in LDAPDN_rewrite, fix normalizer --- diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 3adfe06301..c1c1ba52cf 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -329,8 +329,10 @@ LDAPDN_rewrite( LDAPDN dn, unsigned flags, void *ctx ) if( bv.bv_val ) { - ber_memfree_x( ava->la_value.bv_val, ctx ); + if ( ava->la_flags & LDAP_AVA_FREE_VALUE ) + ber_memfree_x( ava->la_value.bv_val, ctx ); ava->la_value = bv; + ava->la_flags |= LDAP_AVA_FREE_VALUE; } if( do_sort ) AVA_Sort( rdn, iAVA ); diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 0534e2cbbe..8740744507 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -2121,7 +2121,7 @@ certificateExactNormalize( if( val->bv_val[0] != LBER_SEQUENCE ) { /* assume serialNumberAndIssuer */ - return serialNumberAndIssuerNormalize(0,NULL,NULL,val,normalized,NULL); + return serialNumberAndIssuerNormalize(0,NULL,NULL,val,normalized,ctx); } p = val->bv_val;