mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-10 07:10:06 +00:00
Update.
2004-09-08 Ulrich Drepper <drepper@redhat.com> * malloc/malloc.c (_int_free): Add inexpensive double free test.
This commit is contained in:
parent
4924c0072b
commit
9d0cdc0eea
@ -1,3 +1,7 @@
|
||||
2004-09-08 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* malloc/malloc.c (_int_free): Add inexpensive double free test.
|
||||
|
||||
2004-09-08 Roland McGrath <roland@redhat.com>
|
||||
|
||||
* malloc/mcheck.c: Don't use __P.
|
||||
|
@ -4201,6 +4201,13 @@ _int_free(mstate av, Void_t* mem)
|
||||
|
||||
set_fastchunks(av);
|
||||
fb = &(av->fastbins[fastbin_index(size)]);
|
||||
/* Another simple check: make sure the top of the bin is not the
|
||||
record we are going to add (i.e., double free). */
|
||||
if (__builtin_expect (*fb == p, 0))
|
||||
{
|
||||
malloc_printf_nc (check_action, "double free(%p)!\n", mem);
|
||||
return;
|
||||
}
|
||||
p->fd = *fb;
|
||||
*fb = p;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user