From: Howard Chu Date: Sat, 16 Oct 2004 21:32:45 +0000 (+0000) Subject: Free old op->o_sync_csn before allocating new one. (Internal operations X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~427 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1d0e99858a6776469c360692ebcd7423fb0ffaca;p=openldap Free old op->o_sync_csn before allocating new one. (Internal operations using the same op structure, such as in refint overlay, cause a memleak otherwise.) Probably should be using tmpmem for this. --- diff --git a/servers/slapd/ctxcsn.c b/servers/slapd/ctxcsn.c index 3b4bad51af..c927eaf14f 100644 --- a/servers/slapd/ctxcsn.c +++ b/servers/slapd/ctxcsn.c @@ -159,6 +159,7 @@ slap_get_csn( pending = (struct slap_csn_entry *) ch_calloc( 1, sizeof( struct slap_csn_entry )); ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp ); + if ( op->o_sync_csn.bv_val ) free( op->o_sync_csn.bv_val ); ber_dupbv( &op->o_sync_csn, csn ); pending->ce_csn = ber_dupbv( NULL, csn ); pending->ce_connid = op->o_connid;