Skip to content

Commit

Permalink
Fix invalid pointer access in std_allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
foonathan committed May 5, 2020
1 parent bbecda5 commit 897840d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/foonathan/memory/std_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ namespace foonathan
// any_allocator_reference: use virtual function which already does a dispatch on node/array
void* allocate_impl(std::true_type, size_type n)
{
return get_allocator()->allocate_impl(n, sizeof(T), alignof(T));
return get_allocator().allocate_impl(n, sizeof(T), alignof(T));
}

void deallocate_impl(std::true_type, void* ptr, size_type n)
{
get_allocator()->deallocate_impl(ptr, n, sizeof(T), alignof(T));
get_allocator().deallocate_impl(ptr, n, sizeof(T), alignof(T));
}

// alloc_reference: decide between node/array
Expand Down

0 comments on commit 897840d

Please sign in to comment.