]> git.saurik.com Git - apt.git/commitdiff
This is realloc, not reallocf: be more careful :/.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 30 Jan 2017 17:46:25 +0000 (09:46 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 30 Jan 2017 17:46:25 +0000 (09:46 -0800)
apt-pkg/contrib/mmap.cc

index 8fbddbd2f9823bfe838e6445efa0ac2086086aaf..09a3b3230f119b3848bb6f9f30a118dc63cc8ebb 100644 (file)
@@ -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;