[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200427133533.GA20830@embeddedor>
Date: Mon, 27 Apr 2020 08:35:33 -0500
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Josh Poimboeuf <jpoimboe@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>
Subject: [PATCH] objtool: orc_gen: Fix memory leak in create_orc_entry
In case memory resources for rela were allocated, release them before
return.
Addresses-Coverity-ID: 1462331 ("Resource leak")
Fixes: e81e07244325 ("objtool: Support Clang non-section symbols in ORC generation")
Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
---
tools/objtool/orc_gen.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c
index 4c0dabd28000..07b67b1576d7 100644
--- a/tools/objtool/orc_gen.c
+++ b/tools/objtool/orc_gen.c
@@ -120,6 +120,7 @@ static int create_orc_entry(struct elf *elf, struct section *u_sec, struct secti
if (!rela->sym) {
WARN("missing symbol for insn at offset 0x%lx\n",
insn_off);
+ free(rela);
return -1;
}
--
2.26.0
Powered by blists - more mailing lists