summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-10-11 21:48:10 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-10-11 21:48:10 -0700
commit643aca932aa30083246312eeddd2e0d6befa5861 (patch)
tree7427a78646e8162a25a67ae2062e5e7b163a7e8c /Src
parentce929eb37e0a79d847dbfcaf1436c1a46bca55b2 (diff)
downloadzsh-643aca932aa30083246312eeddd2e0d6befa5861.tar.gz
zsh-643aca932aa30083246312eeddd2e0d6befa5861.tar.xz
zsh-643aca932aa30083246312eeddd2e0d6befa5861.zip
One crucial assignment accidentally lost from 36834 when merging 36836.
Diffstat (limited to 'Src')
-rw-r--r--Src/mem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/mem.c b/Src/mem.c
index 191428323..68bd76740 100644
--- a/Src/mem.c
+++ b/Src/mem.c
@@ -386,6 +386,8 @@ freeheap(void)
 	    VALGRIND_MEMPOOL_TRIM((char *)h, (char *)arena(h), h->used);
 #endif
 	} else {
+	    if (fheap == h)
+		fheap = NULL;
 	    if (h->next) {
 		/* We want to cut this out of the arena list if we can */
 		if (h == heaps)
@@ -404,8 +406,6 @@ freeheap(void)
 		fheap = hl = h;
 		break;
 	    }
-	    if (fheap == h)
-		fheap = NULL;
 #ifdef USE_MMAP
 	    munmap((void *) h, h->size);
 #else
@@ -590,6 +590,7 @@ zhalloc(size_t size)
      * so why start over at heaps just because fheap has too little?
      */
     for (h = (fheap ? fheap : heaps); h; h = h->next) {
+	hp = h;
 	if (ARENA_SIZEOF(h) >= (n = size + h->used)) {
 	    void *ret;