Skip to content

Commit

Permalink
Duplicate fix for phmap issue 117 - segfault when out of memory
Browse files Browse the repository at this point in the history
when constructing an object to be inserted throws std::bad_alloc, the slot was mark as used
(even though the object was not properly constructed), so eventually the destructor of a
non-initialized object was called causing a segfault.

Solution: mark the slot used only after the object is successfully constructed.
  • Loading branch information
greg7mdp committed Apr 23, 2023
1 parent 9d7e2b2 commit f4067da
Showing 1 changed file with 147 additions and 124 deletions.
Loading

0 comments on commit f4067da

Please sign in to comment.