Messages in this thread Patch in this message | | | From | Konstantin Meskhidze <> | Subject | [PATCH] objtool: Fix memory leakage | Date | Wed, 30 Nov 2022 18:45:44 +0800 |
| |
This commit fixes potential memory leakage in elf_create_section_symbol() function.
Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.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
| |