Fix bug in prof_realloc

We should pass in `old_ptr` rather than the new `ptr` to
`prof_free_sampled_object()` when `old_ptr` points to a sampled
allocation.
This commit is contained in:
Yinan Zhang 2019-11-15 11:43:25 -08:00
parent e4c36a6f30
commit 3b5eecf102

View File

@ -203,7 +203,7 @@ prof_realloc(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx,
* counters. * counters.
*/ */
if (unlikely(old_sampled)) { if (unlikely(old_sampled)) {
prof_free_sampled_object(tsd, ptr, old_usize, old_tctx); prof_free_sampled_object(tsd, old_ptr, old_usize, old_tctx);
} }
} }