mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-26 13:55:40 +03:00
Fix memory leak of old curr_reg on san_bump_grow_locked failure
When san_bump_grow_locked fails, it sets sba->curr_reg to NULL. The old curr_reg (saved in to_destroy) was never freed or restored, leaking the virtual memory extent. Restore sba->curr_reg from to_destroy on failure so the old region remains usable.
This commit is contained in:
parent
69b3de282b
commit
19057b92e4
2 changed files with 89 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ san_bump_alloc(tsdn_t *tsdn, san_bump_alloc_t *sba, pac_t *pac,
|
|||
bool err = san_bump_grow_locked(
|
||||
tsdn, sba, pac, ehooks, guarded_size);
|
||||
if (err) {
|
||||
sba->curr_reg = to_destroy;
|
||||
goto label_err;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue