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 bd731d7..3382877 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();