mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 19:49:43 +00:00
elf2dmp/pdb: Plug memleak in pdb_init_from_file
Missing g_error_free in pdb_init_from_file() 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-5-kuhn.chenqun@huawei.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
514284d73d
commit
0c4c8671d7
@ -285,6 +285,7 @@ int pdb_init_from_file(const char *name, struct pdb_reader *reader)
|
|||||||
reader->gmf = g_mapped_file_new(name, TRUE, &gerr);
|
reader->gmf = g_mapped_file_new(name, TRUE, &gerr);
|
||||||
if (gerr) {
|
if (gerr) {
|
||||||
eprintf("Failed to map PDB file \'%s\'\n", name);
|
eprintf("Failed to map PDB file \'%s\'\n", name);
|
||||||
|
g_error_free(gerr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user