diff options
author | Pan Nengyuan <pannengyuan@huawei.com> | 2020-10-23 14:12:14 +0800 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2020-12-13 23:56:16 +0100 |
commit | 514284d73d09910451bf00640ee52088e71dbc4b (patch) | |
tree | c4020970d27a95d2656dfac483ad1f22ac952245 /contrib/elf2dmp | |
parent | 8e2c76bd3ff2e81738195bdcc6bfdb8b2ddc7649 (diff) |
elf2dmp/qemu_elf: Plug memleak in QEMU_Elf_init
Missing g_error_free in QEMU_Elf_init() error path. Fix that.
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201023061218.2080844-4-kuhn.chenqun@huawei.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'contrib/elf2dmp')
-rw-r--r-- | contrib/elf2dmp/qemu_elf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/elf2dmp/qemu_elf.c b/contrib/elf2dmp/qemu_elf.c index 0db7816586..b601b6d7ba 100644 --- a/contrib/elf2dmp/qemu_elf.c +++ b/contrib/elf2dmp/qemu_elf.c @@ -126,6 +126,7 @@ int QEMU_Elf_init(QEMU_Elf *qe, const char *filename) qe->gmf = g_mapped_file_new(filename, TRUE, &gerr); if (gerr) { eprintf("Failed to map ELF dump file \'%s\'\n", filename); + g_error_free(gerr); return 1; } |