mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 10:41:11 +02: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:
parent
1584318b97
commit
23f98c3e1d
2 changed files with 16 additions and 0 deletions
|
@ -1,5 +1,12 @@
|
|||
2014-01-18 Barton E. Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 32285: Src/mem.c (freeheap): when the last-arena-with-free-space
|
||||
pointer (fheap) points to an arena that is going to be discarded
|
||||
because it has become empty, loop back through the entire linked
|
||||
list of arenas to find another partly-filled arena; fixes crash
|
||||
wherein pushheap followed by freeheap could orphan the whole list
|
||||
of arenas in some circumstances
|
||||
|
||||
* 32283: Src/Zle/complist.c: avoid using a negative number for
|
||||
available vertical space when the terminal has only a small number
|
||||
of lines; fixes crash in menu selection
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue