mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-21 03:15:38 +03:00
Eagerly detect double free and sized dealloc bugs for large sizes.
This commit is contained in:
parent
be9548f2be
commit
3de19ba401
7 changed files with 136 additions and 23 deletions
|
|
@ -2812,7 +2812,7 @@ maybe_check_alloc_ctx(tsd_t *tsd, void *ptr, emap_alloc_ctx_t *alloc_ctx) {
|
|||
&dbg_ctx);
|
||||
if (alloc_ctx->szind != dbg_ctx.szind) {
|
||||
safety_check_fail_sized_dealloc(
|
||||
/* curent_dealloc */ true);
|
||||
/* current_dealloc */ true);
|
||||
return true;
|
||||
}
|
||||
if (alloc_ctx->slab != dbg_ctx.slab) {
|
||||
|
|
|
|||
|
|
@ -428,6 +428,10 @@ tcache_bin_flush_impl(tsd_t *tsd, tcache_t *tcache, cache_bin_t *cache_bin,
|
|||
dalloc_count++;
|
||||
}
|
||||
} else {
|
||||
if (large_dalloc_safety_checks(edata, binind)) {
|
||||
/* See the comment in isfree. */
|
||||
continue;
|
||||
}
|
||||
large_dalloc_finish(tsdn, edata);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue