summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2017-01-30 09:46:25 -0800
committerSam Bingner <sam@bingner.com>2019-08-17 12:47:30 -1000
commit81a249a8b7eea16d66c20300e68941e6c04d7800 (patch)
tree0c84f12b27c36e9f00503ee93eb9d1d52785960c
parent6841caf6016ced45ccf3e540f9e6d40d13c58ec1 (diff)
This is realloc, not reallocf: be more careful :/.
-rw-r--r--apt-pkg/contrib/mmap.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc
index 0330e5700..cea9ec1ee 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -487,12 +487,14 @@ bool DynamicMMap::Grow() {
if ((Flags & Moveable) != Moveable)
return false;
- Base = realloc(Base, newSize);
- if (Base == NULL)
+ auto Temp = realloc(Base, newSize);
+ if (Temp == NULL)
return false;
- else
+ else {
+ Base = Temp;
/* Set new memory to 0 */
memset((char*)Base + WorkSpace, 0, newSize - WorkSpace);
+ }
}
Pools =(Pool*) Base + poolOffset;