Fixed rare heap-use-after-free bug
authorkhizmax <libcds.dev@gmail.com>
Sat, 6 Aug 2016 07:09:24 +0000 (10:09 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 6 Aug 2016 07:09:24 +0000 (10:09 +0300)
cds/intrusive/impl/feldman_hashset.h

index bd731d7f5813d8915558268ae8f25b1ea2c37478..33828773f6287aad8a98571ba87bcaaf1c589f66 100644 (file)
@@ -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();