From: khizmax Date: Tue, 29 Nov 2016 19:51:31 +0000 (+0300) Subject: Fixed use-after-free bug X-Git-Tag: v2.2.0~35 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cf5a1db75c8054b8152cde54d0256dd7fd0a5335;p=libcds.git Fixed use-after-free bug --- diff --git a/cds/algo/flat_combining/kernel.h b/cds/algo/flat_combining/kernel.h index cbc39b77..aa240004 100644 --- a/cds/algo/flat_combining/kernel.h +++ b/cds/algo/flat_combining/kernel.h @@ -291,7 +291,9 @@ namespace cds { namespace algo { /// Destroys the objects and mark all publication records as inactive ~kernel() { - // mark all publication record as detached + m_pThreadRec.reset(); // calls tls_cleanup() + + // delete all publication records for ( publication_record* p = m_pHead; p; ) { publication_record * pRec = p; p = p->pNext.load( memory_model::memory_order_relaxed );