Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2013-10-12 23:19:01 +0400
committerKenneth Heafield <github@kheafield.com>2013-10-12 23:19:01 +0400
commit208116c5c1088740773d81083bd73b2bec7d2ce7 (patch)
treeaf7014926f0607b196972cdb46ce2a7893e3dc5c /util
parenta554918834fdac5d858db4df6fa28257b2dedd6d (diff)
Fix call_realloc double free
Diffstat (limited to 'util')
-rw-r--r--util/mmap.cc4
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;
}
}