]> git.sur5r.net Git - openldap/commitdiff
ITS#8014 plug onetime leak in slapadd -w
authorHoward Chu <hyc@openldap.org>
Sun, 4 Jan 2015 07:00:14 +0000 (07:00 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 5 Jan 2015 19:47:45 +0000 (13:47 -0600)
servers/slapd/slapcommon.c

index e827d18c955c9031373f016356d1335b34c0e3cd..ca8ac021d32cfd34b98413b7558b48a46334deac 100644 (file)
@@ -996,6 +996,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;
@@ -1003,9 +1004,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;