From 9019ea74eeab5aa20e91fb48b914d42bc9f746d8 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 19 Mar 2006 23:26:12 +0000 Subject: [PATCH] fix leak --- servers/slapd/ad.c | 10 ++++++---- servers/slapd/back-monitor/entry.c | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 7183d5e59f..4ac9b6a8c0 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -1177,11 +1177,13 @@ ad_define_option( const char *name, const char *fname, int lineno ) return 0; } -void ad_unparse_options( BerVarray *res ){ +void +ad_unparse_options( BerVarray *res ) +{ int i; - for ( i=0; i < option_count; i++ ) { - ber_bvarray_add( res, ber_bvdup( &(options[i].name) )); - } + for ( i = 0; i < option_count; i++ ) { + value_add_one( res, &options[i].name ); + } } /* Find the definition of the option name or prefix matching the arguments */ diff --git a/servers/slapd/back-monitor/entry.c b/servers/slapd/back-monitor/entry.c index 6ccdb9abdb..282b250c0b 100644 --- a/servers/slapd/back-monitor/entry.c +++ b/servers/slapd/back-monitor/entry.c @@ -198,6 +198,7 @@ monitor_entry_stub( rdnNormalize( 0, NULL, NULL, rdn, &nrdn, NULL ); build_new_dn( &e->e_name, pdn, rdn, NULL ); build_new_dn( &e->e_nname, pndn, &nrdn, NULL ); + ber_memfree( nrdn.bv_val ); nat.bv_val = ptr + 1; nat.bv_len = rdn->bv_len - ( nat.bv_val - rdn->bv_val ); attr_merge_normalize_one( e, slap_schema.si_ad_objectClass,