mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-18 23:52:14 -06:00
linux-user/elfload: Don't close an unopened file descriptor
Fixes Coverity CID: 1534964
Fixes: 106f8da664
("linux-user/elfload: Open core file after vma_init")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
8de24b1563
commit
b35348c7e6
1 changed files with 3 additions and 1 deletions
|
@ -4522,7 +4522,9 @@ static int elf_core_dump(int signr, const CPUArchState *env)
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
mmap_unlock();
|
mmap_unlock();
|
||||||
cpu_list_unlock();
|
cpu_list_unlock();
|
||||||
close(fd);
|
if (fd >= 0) {
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* USE_ELF_CORE_DUMP */
|
#endif /* USE_ELF_CORE_DUMP */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue