From dee604c6083015262f0442097ad6514b67bc2db7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 18 Oct 2003 05:49:58 +0000 Subject: [PATCH] ITS#2771 fix memory usage in LDAPDN_rewrite, fix normalizer --- servers/slapd/dn.c | 4 +++- servers/slapd/schema_init.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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; -- 2.39.5