From ad0bad280c5d7cf82bbd10eb7e5b006cbefdb6de Mon Sep 17 00:00:00 2001 From: khizmax Date: Sat, 6 Aug 2016 10:09:24 +0300 Subject: [PATCH] Fixed rare heap-use-after-free bug --- cds/intrusive/impl/feldman_hashset.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cds/intrusive/impl/feldman_hashset.h b/cds/intrusive/impl/feldman_hashset.h index bd731d7f..33828773 100644 --- a/cds/intrusive/impl/feldman_hashset.h +++ b/cds/intrusive/impl/feldman_hashset.h @@ -630,8 +630,7 @@ namespace cds { namespace intrusive { // slot value has been changed - retry stats().onSlotChanged(); } - - if ( slot.ptr()) { + else if ( slot.ptr()) { if ( cmp( hash, hash_accessor()( *slot.ptr())) == 0 ) { // the item with that hash value already exists stats().onInsertFailed(); -- 2.34.1