Re: [PATCH] objtool: Fix memory leak in create_static_call_section()

From: Peter Zijlstra
Date: Wed Jul 27 2022 - 11:55:39 EST


On Wed, Jul 27, 2022 at 06:48:25PM +0300, Stanislav Goriainov wrote:
> On some paths of function create_static_call_section() the memory,
> allocated for key_name via strdup(), is not freed. Even though this
> is a utility function, and all memory will be freed automatically
> after the process is finished, there is free(key_sym) in some cases,
> so it would be sensible to always deallocate the memory.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>

This is a run-once die on error program. This is pointless and most
certainly doesn't 'fix' anything.