From 208116c5c1088740773d81083bd73b2bec7d2ce7 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Sat, 12 Oct 2013 20:19:01 +0100 Subject: Fix call_realloc double free --- util/mmap.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util') 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; } } -- cgit v1.2.3