Re: [PATCH] platform/x86/amd: Fix memory leak in wbrf_record()

From: Zilin Guan

Date: Tue Dec 30 2025 - 04:17:30 EST


On Tue, Dec 30, 2025 at 09:51:06AM+0100, Markus Elfring wrote:
>
> > Fix this by adding a free_tmp label and jumping to it when obj is NULL,
> > ensuring tmp is properly freed.
>
> How do you think about to increase the application of scope-based resource management?
>
> Regards,
> Markus

Thanks for the suggestion.

While scope-based resource management is a valid improvement, I prefer to
keep this patch focused solely on fixing the memory leak using the
existing coding style of the file. This ensures the fix is minimal and
easier to backport.

Such refactoring is arguably outside the scope of this fix.

Regards,
Zilin Guan