From: Howard Chu Date: Thu, 7 Jun 2012 17:38:02 +0000 (-0700) Subject: ITS#7292 plug memleaks in accesslog,syncprov X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4dba1f696323cadd247103b3fb93fdd76a04ea6c;p=openldap ITS#7292 plug memleaks in accesslog,syncprov --- diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index 2d32f3cc24..20452cd97b 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -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 ) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 25e7350337..3a8c62649e 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -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 );