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:
parent
e4c36a6f30
commit
3b5eecf102
@ -203,7 +203,7 @@ prof_realloc(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx,
|
||||
* counters.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user