summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2017-01-30 09:46:25 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2017-01-30 09:46:25 -0800
commitf1788cf1c819d4c003ae046367af00203cd027d6 (patch)
treeddcd6cfe8eba710941440a466122a7dd9f9a1b13 /apt-pkg/contrib
parentf932bccbf7f8e8c06cb978e9a9b722d1b583c358 (diff)
This is realloc, not reallocf: be more careful :/.
Diffstat (limited to 'apt-pkg/contrib')
-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 8fbddbd2f..09a3b3230 100644
--- a/apt-pkg/contrib/mmap.cc
+++ b/apt-pkg/contrib/mmap.cc
@@ -489,12 +489,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;