mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
gdbstub: Prevent fd leakage
Since 2f652224f7
, we now check if socket_set_nodelay() errored,
but forgot to close the socket before reporting an error.
Fixes: Coverity CID 1391290 (RESOURCE_LEAK)
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180524223458.5651-1-f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
3a0adfc9bf
commit
ead75d84cb
1 changed files with 1 additions and 0 deletions
|
@ -1842,6 +1842,7 @@ static bool gdb_accept(void)
|
|||
/* set short latency */
|
||||
if (socket_set_nodelay(fd)) {
|
||||
perror("setsockopt");
|
||||
close(fd);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue