Re: [PATCH] objtool: fix memory leak in tools/objtool/elf.c

From: Josh Poimboeuf

Date: Mon Sep 22 2025 - 16:10:49 EST


On Mon, Sep 22, 2025 at 05:03:24PM +0800, liujing wrote:
> If calloc succeeds but malloc fails (i.e., sym != NULL but name == NULL),
> then memory has already been allocated for sym via calloc, but atthis
> point sym is not freed, leading to a memory leak.
>
> Signed-off-by: liujing <liujing@xxxxxxxxxxxxxxxxxxxx>

We intentionally don't fix most memory leaks, objtool has a short
runtime and all the memory gets freed on exit anyway.

--
Josh