objtool: Fix memory leak in check.c
PATCH 1/1 objtool: Fix memory leak in check.c
In the 'disas_funcs' function of check.c, the 'cmd' string used to store a command is not being freed after it's used, leading to a memory leak. This patch adds the necessary 'free(cmd)' statement to release the allocated memory.
Signed-off-by Kuan-Wei Chiu <[email protected]>
--- tools/objtool/check.c | 1 + 1 file changed, 1 insertion(+)
tools/objtool/check.c +1 -0
@@ -4589,6 +4589,7 @@ static int disas_funcs(const char *funcs)/* real snprintf() */ snprintf (cmd, size, objdump_str, cross_compile, objname, funcs); ret =system (cmd); +free (cmd);if (ret) {WARN ("disassembly failed: %d" , ret);return -1 ;
Signature · 1 line
2.25.1
Peter Zijlstra
maintainerQuoted 4 lines · Kuan-Wei Chiu
In the '
disas_funcs' function ofcheck.c, the 'cmd' string used to store a command is not being freed after it's used, leading to a memory leak. This patch adds the necessary 'free(cmd)' statement to release the allocated memory.
It'll exit more or less right after doing this.