From cb8b23efb2020773d1b6761918699e21ebc7ddef Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Mon, 23 Nov 1998 04:35:26 +0000 Subject: [PATCH] Plug memory leaks --- servers/slapd/schemaparse.c | 11 +++++++---- servers/slapd/tools/ldif2id2children.c | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index 96e01f09b0..08640bda5e 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -36,9 +36,10 @@ parse_oc( do { i++; if ( i < argc ) { + char **s = str2charray( argv[i], "," ); last = argv[i][strlen( argv[i] ) - 1]; - charray_merge( &oc->oc_required, - str2charray( argv[i], "," ) ); + charray_merge( &oc->oc_required, s ); + charray_free( s ); } } while ( i < argc && last == ',' ); @@ -47,9 +48,11 @@ parse_oc( do { i++; if ( i < argc ) { + char **s = str2charray( argv[i], "," ); last = argv[i][strlen( argv[i] ) - 1]; - charray_merge( &oc->oc_allowed, - str2charray( argv[i], "," ) ); + + charray_merge( &oc->oc_allowed, s ); + charray_free( s ); } } while ( i < argc && last == ',' ); diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index 4c802e1f44..5e709dc9bc 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -270,6 +270,7 @@ main( int argc, char **argv ) data = ldbm_fetch( db->dbc_db, key ); + free( dn ); if ( data.dptr == NULL ) { dn_normalize( val ); if ( ! be_issuffix( be, -- 2.39.5