[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20221130104544.2789085-1-konstantin.meskhidze@huawei.com>
Date: Wed, 30 Nov 2022 18:45:44 +0800
From: Konstantin Meskhidze <konstantin.meskhidze@...wei.com>
To: <jpoimboe@...nel.org>
CC: <peterz@...radead.org>, <nathan@...nel.org>,
<ndesaulniers@...gle.com>, <trix@...hat.com>,
<linux-kernel@...r.kernel.org>, <llvm@...ts.linux.dev>,
<yusongping@...wei.com>, <hukeping@...wei.com>,
<artem.kuzin@...wei.com>
Subject: [PATCH] objtool: Fix memory leakage
This commit fixes potential memory leakage in
elf_create_section_symbol() function.
Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@...wei.com>
---
tools/objtool/elf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 7e24b09b1163..58f30840358f 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -776,6 +776,7 @@ elf_create_section_symbol(struct elf *elf, struct section *sec)
if (elf_update_symbol(elf, symtab, symtab_shndx, old)) {
WARN("elf_update_symbol move");
+ free(sym);
return NULL;
}
@@ -785,6 +786,7 @@ elf_create_section_symbol(struct elf *elf, struct section *sec)
sym->idx = new_idx;
if (elf_update_symbol(elf, symtab, symtab_shndx, sym)) {
WARN("elf_update_symbol");
+ free(sym);
return NULL;
}
--
2.25.1
Powered by blists - more mailing lists