diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-10-12 23:19:01 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-10-12 23:19:01 +0400 |
commit | 208116c5c1088740773d81083bd73b2bec7d2ce7 (patch) | |
tree | af7014926f0607b196972cdb46ce2a7893e3dc5c /util/mmap.cc | |
parent | a554918834fdac5d858db4df6fa28257b2dedd6d (diff) |
Fix call_realloc double free
Diffstat (limited to 'util/mmap.cc')
-rw-r--r-- | util/mmap.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/mmap.cc b/util/mmap.cc index 6f79f26f5..cee6a9709 100644 --- a/util/mmap.cc +++ b/util/mmap.cc @@ -90,7 +90,9 @@ void scoped_memory::call_realloc(std::size_t size) { if (!new_data) { reset(); } else { - reset(new_data, size, MALLOC_ALLOCATED); + data_ = new_data; + size_ = size; + source_ = MALLOC_ALLOCATED; } } |