From: Kurt Zeilenga Date: Fri, 4 Dec 1998 02:20:39 +0000 (+0000) Subject: Plug a leak reported by Jorg Pietschmann X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~966 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=339c23549be7b9c54903bd47a16421889ae4b749;p=openldap Plug a leak reported by Jorg Pietschmann Still leaks ber_scanf results here and there... --- 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 );