From: Howard Chu Date: Mon, 13 Nov 2006 02:45:05 +0000 (+0000) Subject: ITS#4746 leak fix from HEAD X-Git-Tag: OPENLDAP_REL_ENG_2_3_30~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f2cd7fc59ced05d7840db8797d24d7fb87fe04e;p=thirdparty%2Fopenldap.git ITS#4746 leak fix from HEAD --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index cd989343e4..91acfc19d1 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1410,6 +1410,8 @@ syncrepl_message_to_op( } done: slap_graduate_commit_csn( op ); + op->o_tmpfree( op->o_csn.bv_val, op->o_tmpmemctx ); + BER_BVZERO( &op->o_csn ); if ( modlist ) slap_mods_free( modlist, op->o_tag != LDAP_REQ_ADD ); if ( !BER_BVISNULL( &rdn )) { @@ -2074,6 +2076,7 @@ syncrepl_del_nonpresent( slap_uuidstr_from_normalized( &uf.f_av_value, &uuids[i], op->o_tmpmemctx ); filter2bv_x( op, op->ors_filter, &op->ors_filterstr ); + op->o_tmpfree( uf.f_av_value.bv_val, op->o_tmpmemctx ); uf.f_av_value = uuids[i]; rc = be->be_search( op, &rs_search ); op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx ); @@ -2145,6 +2148,7 @@ syncrepl_del_nonpresent( op->orm_modlist = &mod1; rc = be->be_modify( op, &rs_modify ); + if ( mod2.sml_next ) slap_mods_free( mod2.sml_next, 1 ); } while ( rs_delete.sr_err == LDAP_SUCCESS && @@ -2172,6 +2176,8 @@ syncrepl_del_nonpresent( } slap_graduate_commit_csn( op ); + op->o_tmpfree( op->o_csn.bv_val, op->o_tmpmemctx ); + BER_BVZERO( &op->o_csn ); } return; @@ -2372,6 +2378,9 @@ syncrepl_updateCookie( } slap_graduate_commit_csn( op ); + op->o_tmpfree( op->o_csn.bv_val, op->o_tmpmemctx ); + BER_BVZERO( &op->o_csn ); + if ( mod.sml_next ) slap_mods_free( mod.sml_next, 1 ); return; }