[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170914060138.26472-1-martink@posteo.de>
Date: Thu, 14 Sep 2017 08:01:38 +0200
From: Martin Kepplinger <martink@...teo.de>
To: mingo.kernel.org@...il.com, jpoimboe@...hat.com
Cc: linux-kernel@...r.kernel.org, Martin Kepplinger <martink@...teo.de>
Subject: [PATCH v2] tools: objtool: fix memory leak in elf_create_rela_section()
Let's free the allocated char array relaname before returning
in order to avoid leaking memory.
Signed-off-by: Martin Kepplinger <martink@...teo.de>
---
I should've allocated some brain resources before freeing some computer's.
tools/objtool/elf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 6e9f980a7d26..1e89a5f8bfc9 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -508,6 +508,7 @@ struct section *elf_create_rela_section(struct elf *elf, struct section *base)
strcat(relaname, base->name);
sec = elf_create_section(elf, relaname, sizeof(GElf_Rela), 0);
+ free(relaname);
if (!sec)
return NULL;
--
2.11.0
Powered by blists - more mailing lists