From 7ceaad7eb2b06da51e1c30dd42c16d945494db5e Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 29 Aug 2007 00:27:47 +0000 Subject: [PATCH] plug yet another leak --- servers/slapd/overlays/syncprov.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 ); } -- 2.39.5