Re: [PATCH] perf intel-pt: Free the old snapshot reference array after growing it
From: Arnaldo Carvalho de Melo
Date: Wed Nov 04 2026 - 20:47:06 EST
On Wed, Nov 04, 2026 at 11:50:02AM +0200, Adrian Hunter wrote:
> On 04/11/2026 04:19, lirongqing wrote:
> > From: Li RongQing <lirongqing@xxxxxxxxx>
> >
> > Growing snapshot_refs allocates a new array and copies the old entries,
> > then overwrites the only pointer to the old array. Snapshot recording
> > with more than sixteen AUX mappings leaks that allocation on expansion.
> >
> > Free the old array after copying its entries. The reference buffers are
> > still owned by the entries copied into the replacement array.
> >
> > Fixes: 90e457f7be08 ("perf tools: Add Intel PT support")
> > Signed-off-by: Li RongQing <lirongqing@xxxxxxxxx>
>
> Reviewed-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Thanks, applied for v7.4.
- Arnaldo