mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
* dlfcn/Makefile (LDLIBS-bug-atexit3-lib.so): Add
ld.so. * malloc/malloc.c (_int_malloc): Use full list insert and not shortcut which assumes the list is empty for large requests too. * elf/tst-addr1.c (do_test): Allow i.dli_sname "_IO_printf".
This commit is contained in:
@ -4230,8 +4230,14 @@ _int_malloc(mstate av, size_t bytes)
|
||||
/* Split */
|
||||
else {
|
||||
remainder = chunk_at_offset(victim, nb);
|
||||
unsorted_chunks(av)->bk = unsorted_chunks(av)->fd = remainder;
|
||||
remainder->bk = remainder->fd = unsorted_chunks(av);
|
||||
/* We cannot assume the unsorted list is empty and therefore
|
||||
have to perform a complete insert here. */
|
||||
bck = unsorted_chunks(av);
|
||||
fwd = bck->fd;
|
||||
remainder->bk = bck;
|
||||
remainder->fd = fwd;
|
||||
bck->fd = remainder;
|
||||
fwd->bk = remainder;
|
||||
set_head(victim, nb | PREV_INUSE |
|
||||
(av != &main_arena ? NON_MAIN_ARENA : 0));
|
||||
set_head(remainder, remainder_size | PREV_INUSE);
|
||||
|
Reference in New Issue
Block a user