mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-19 11:26:26 +03:00
Fix irealloc_prof() to prof_alloc_rollback() on OOM.
This commit is contained in:
parent
46ff049128
commit
ef363de701
2 changed files with 4 additions and 1 deletions
|
|
@ -1712,8 +1712,10 @@ irealloc_prof(tsd_t *tsd, void *oldptr, size_t old_usize, size_t usize)
|
|||
p = irealloc_prof_sample(tsd, oldptr, old_usize, usize, tctx);
|
||||
else
|
||||
p = iralloc(tsd, oldptr, old_usize, usize, 0, false);
|
||||
if (p == NULL)
|
||||
if (unlikely(p == NULL)) {
|
||||
prof_alloc_rollback(tsd, tctx, true);
|
||||
return (NULL);
|
||||
}
|
||||
prof_realloc(tsd, p, usize, tctx, true, old_usize, old_tctx);
|
||||
|
||||
return (p);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue