From: Pierangelo Masarati Date: Wed, 29 Aug 2007 00:27:47 +0000 (+0000) Subject: plug yet another leak X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~44 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7ceaad7eb2b06da51e1c30dd42c16d945494db5e;p=openldap plug yet another leak --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index ff36ef0a20..a817700622 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -2308,10 +2308,15 @@ syncprov_operational( a = attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_contextCSN ); } - free( a->a_vals ); + if ( a->a_nvals != a->a_vals ) { + ber_bvarray_free( a->a_nvals ); + } + a->a_nvals = NULL; + ber_bvarray_free( a->a_vals ); + a->a_vals = NULL; } ber_bvarray_dup_x( &a->a_vals, si->si_ctxcsn, NULL ); - a->a_nvals = a->a_vals; + ber_bvarray_dup_x( &a->a_nvals, si->si_ctxcsn, NULL ); } ldap_pvt_thread_rdwr_runlock( &si->si_csn_rwlock ); }