PR33854: fix regression in dwflst_perf_sample_getframes
In commit
3ce0d5ed, I missed the fact that
dwflst_perf_sample_getframes needs to handle the case of an unattached
Dwfl, when dwfl->process->ebl is not yet available to translate the
registers. Thus, it can't be a straightforward wrapper of
dwfl_sample_getframes, but should instead handle the attaching logic
identically to that function.
Also fix a leakage of sample_arg in dwflst_sample_getframes that was
happening on attach failure.
* libdwfl_stacktrace (dwflst_sample_getframes): Fix a leak of
sample_arg on attach failure.
* libdwfl_stacktrace (dwflst_perf_sample_getframes): Implement
attaching the Dwfl identically to dwflst_sample_getframes.
Avoid leaking sample_arg on attach failure.
Signed-off-by: Serhei Makarov <serhei@serhei.io>