From 339c23549be7b9c54903bd47a16421889ae4b749 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 4 Dec 1998 02:20:39 +0000 Subject: [PATCH] Plug a leak reported by Jorg Pietschmann Still leaks ber_scanf results here and there... --- servers/slapd/add.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 60ae1cf93d..0f497a0d73 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -45,10 +45,6 @@ do_add( Connection *conn, Operation *op ) * } */ - e = (Entry *) ch_calloc( 1, sizeof(Entry) ); - /* initialize reader/writer lock */ - entry_rdwr_init(e); - /* get the name */ if ( ber_scanf( ber, "{a", &dn ) == LBER_ERROR ) { Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 ); @@ -56,6 +52,11 @@ do_add( Connection *conn, Operation *op ) "decoding error" ); return; } + + e = (Entry *) ch_calloc( 1, sizeof(Entry) ); + /* initialize reader/writer lock */ + entry_rdwr_init(e); + e->e_dn = dn; dn = dn_normalize( ch_strdup( dn ) ); Debug( LDAP_DEBUG_ARGS, " do_add: dn (%s)\n", dn, 0, 0 ); -- 2.39.5