]> git.sur5r.net Git - openldap/commitdiff
ITS#7292 plug memleaks in accesslog,syncprov
authorHoward Chu <hyc@openldap.org>
Thu, 7 Jun 2012 17:38:02 +0000 (10:38 -0700)
committerHoward Chu <hyc@openldap.org>
Thu, 7 Jun 2012 18:33:20 +0000 (11:33 -0700)
servers/slapd/overlays/accesslog.c
servers/slapd/overlays/syncprov.c

index 2d32f3cc24670c68f4a1d1cd170b1cd227ef2808..20452cd97bb750b6ac4ca503c7d72b74e6a0c4c4 100644 (file)
@@ -1457,7 +1457,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
        Modifications *m;
        struct berval *b, uuid = BER_BVNULL;
        int i;
-       int logop;
+       int logop, do_graduate = 0;
        slap_verbmasks *lo;
        Entry *e = NULL, *old = NULL, *e_uuid = NULL;
        char timebuf[LDAP_LUTIL_GENTIME_BUFSIZE+8];
@@ -1829,11 +1829,14 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
 
        if (( lo->mask & LOG_OP_WRITES ) && !BER_BVISEMPTY( &op->o_csn )) {
                slap_queue_csn( &op2, &op->o_csn );
+               do_graduate = 1;
        }
 
        op2.o_bd->be_add( &op2, &rs2 );
        if ( e == op2.ora_e ) entry_free( e );
        e = NULL;
+       if ( do_graduate )
+               slap_graduate_commit_csn( &op2 );
 
 done:
        if ( lo->mask & LOG_OP_WRITES )
index 25e735033712696f3955915c37ac0b9ca20609ca..3a8c62649e3973005431ac19755123f319f979b5 100644 (file)
@@ -2353,6 +2353,7 @@ syncprov_search_response( Operation *op, SlapReply *rs )
                        slap_compose_sync_cookie( op, &cookie, a->a_nvals, srs->sr_state.rid, slap_serverID ? slap_serverID : -1 );
                        rs->sr_err = syncprov_state_ctrl( op, rs, rs->sr_entry,
                                LDAP_SYNC_ADD, rs->sr_ctrls, 0, 1, &cookie );
+                       op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
                } else {
                        rs->sr_err = syncprov_state_ctrl( op, rs, rs->sr_entry,
                                LDAP_SYNC_ADD, rs->sr_ctrls, 0, 0, NULL );