[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-5d0be52d44e32ae98b1345e9ecfa6a97783ca2c9@git.kernel.org>
Date: Thu, 14 Sep 2017 07:06:58 -0700
From: tip-bot for Martin Kepplinger <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: peterz@...radead.org, martink@...teo.de, tglx@...utronix.de,
hpa@...or.com, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, dzickus@...hat.com, mingo@...nel.org,
jpoimboe@...hat.com
Subject: [tip:core/urgent] tools/objtool: Fix memory leak in
elf_create_rela_section()
Commit-ID: 5d0be52d44e32ae98b1345e9ecfa6a97783ca2c9
Gitweb: http://git.kernel.org/tip/5d0be52d44e32ae98b1345e9ecfa6a97783ca2c9
Author: Martin Kepplinger <martink@...teo.de>
AuthorDate: Thu, 14 Sep 2017 08:01:38 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 14 Sep 2017 16:02:30 +0200
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>
Reviewed-by: Don Zickus <dzickus@...hat.com>
Acked-by: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: mingo.kernel.org@...il.com
Link: http://lkml.kernel.org/r/20170914060138.26472-1-martink@posteo.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
tools/objtool/elf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 6e9f980..1e89a5f 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;
Powered by blists - more mailing lists