From: Howard Chu Date: Sun, 4 Jan 2015 07:00:14 +0000 (+0000) Subject: ITS#8014 plug onetime leak in slapadd -w X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c5cc2f241ff182689f665061287d63dabde11720;p=openldap ITS#8014 plug onetime leak in slapadd -w --- diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index 01a49554eb..899ae93900 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -1003,6 +1003,7 @@ slap_tool_update_ctxcsn( fprintf( stderr, "%s: couldn't create context entry\n", progname ); rc = EXIT_FAILURE; } + entry_free( ctxcsn_e ); } else { fprintf( stderr, "%s: context entry is missing\n", progname ); rc = EXIT_FAILURE; @@ -1010,9 +1011,14 @@ slap_tool_update_ctxcsn( } else { ctxcsn_e = be->be_entry_get( be, ctxcsn_id ); if ( ctxcsn_e != NULL ) { + Operation op = { 0 }; Entry *e = entry_dup( ctxcsn_e ); - int change; Attribute *attr = attr_find( e->e_attrs, slap_schema.si_ad_contextCSN ); + + int change; + op.o_bd = be; + be_entry_release_r( &op, ctxcsn_e ); + if ( attr ) { int i;