From: Howard Chu Date: Sun, 11 May 2003 08:42:58 +0000 (+0000) Subject: Plug leak in hdb X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~148 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=236321ce9c03da3ff0d345d89596205ed5be0e54;p=openldap Plug leak in hdb --- diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index b758769eb9..2660b697d2 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -169,17 +169,17 @@ int bdb_entry_return( e->e_name.bv_val = NULL; e->e_nname.bv_val = NULL; } + /* In tool mode the e_bv buffer is realloc'd, leave it alone */ + if( !(slapMode & SLAP_TOOL_MODE) ) { + free( e->e_bv.bv_val ); + } #else /* We had to construct the dn and ndn as well, in a single block */ if( e->e_name.bv_val ) { free( e->e_name.bv_val ); } + free( e->e_bv.bv_val ); #endif - /* In tool mode the e_bv buffer is realloc'd, leave it alone */ - if( !(slapMode & SLAP_TOOL_MODE) ) { - free( e->e_bv.bv_val ); - } - free( e ); return 0;