1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-26 04:30:27 +01:00

32285: restart the fheap search in freeheap if the current fheap arena is about to be discarded; fixes crash

This commit is contained in:
Barton E. Schaefer 2014-01-18 21:22:11 -08:00
parent 1584318b97
commit 23f98c3e1d
2 changed files with 16 additions and 0 deletions

View file

@ -367,6 +367,15 @@ freeheap(void)
}
#endif
} else {
if (h == fheap && h != heaps) {
/*
* When deallocating the last arena with free space,
* loop back through the list to find another one.
*/
fheap = NULL;
hn = heaps;
continue;
}
#ifdef USE_MMAP
munmap((void *) h, h->size);
#else