Fix irealloc_prof() to prof_alloc_rollback() on OOM.
This commit is contained in:
parent
46ff049128
commit
ef363de701
@ -28,6 +28,7 @@ brevity. Much more detail can be found in the git revision history:
|
|||||||
segfault.
|
segfault.
|
||||||
- Fix xallocx() bugs related to the 'extra' parameter when specified as
|
- Fix xallocx() bugs related to the 'extra' parameter when specified as
|
||||||
non-zero.
|
non-zero.
|
||||||
|
- Fix irealloc_prof() to prof_alloc_rollback() on OOM.
|
||||||
|
|
||||||
* 4.0.0 (August 17, 2015)
|
* 4.0.0 (August 17, 2015)
|
||||||
|
|
||||||
|
@ -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);
|
p = irealloc_prof_sample(tsd, oldptr, old_usize, usize, tctx);
|
||||||
else
|
else
|
||||||
p = iralloc(tsd, oldptr, old_usize, usize, 0, false);
|
p = iralloc(tsd, oldptr, old_usize, usize, 0, false);
|
||||||
if (p == NULL)
|
if (unlikely(p == NULL)) {
|
||||||
|
prof_alloc_rollback(tsd, tctx, true);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
}
|
||||||
prof_realloc(tsd, p, usize, tctx, true, old_usize, old_tctx);
|
prof_realloc(tsd, p, usize, tctx, true, old_usize, old_tctx);
|
||||||
|
|
||||||
return (p);
|
return (p);
|
||||||
|
Loading…
Reference in New Issue
Block a user