]> git.sur5r.net Git - openldap/commitdiff
Free old op->o_sync_csn before allocating new one. (Internal operations
authorHoward Chu <hyc@openldap.org>
Sat, 16 Oct 2004 21:32:45 +0000 (21:32 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 16 Oct 2004 21:32:45 +0000 (21:32 +0000)
using the same op structure, such as in refint overlay, cause a memleak
otherwise.) Probably should be using tmpmem for this.

servers/slapd/ctxcsn.c

index 3b4bad51af2d7c466d56bde62a9f19259e179cc9..c927eaf14f1f45967c1fc891080a4500c4febd99 100644 (file)
@@ -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;