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
@ -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();
|
||||||
|
if (fd >= 0) {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* USE_ELF_CORE_DUMP */
|
#endif /* USE_ELF_CORE_DUMP */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user