On Mon, Feb 2, 2026, at 8:16 PM, Aaron Merey wrote:
> It looks like this return leaks sample_arg. You may need to also free
> it for the error returns below.
Good catch, the same issue applies in already-existing dwfl_sample_getframes() 
code. I posted a v2 patch that fixes the problem in the existing code as well.

Once the dwfl is attached, sample_arg is linked to it, and freeing it on an 
unrelated error is not appropriate until the dwfl is also detached/freed. In 
that case deallocation of sample_arg happens on the code path dwfl_end -> 
__libdwfl_process_free -> detach i.e. sample_detach() in dwflst_sample_frame.c.

Reply via email to