[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 41/53] gdbstub: Prevent fd leakage

From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 41/53] gdbstub: Prevent fd leakage
Date: Thu, 31 May 2018 19:15:54 +0200

From: Philippe Mathieu-Daudé <address@hidden>

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é <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
 gdbstub.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdbstub.c b/gdbstub.c
index 6081e719c5..d6ab95006c 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1842,6 +1842,7 @@ static bool gdb_accept(void)
     /* set short latency */
     if (socket_set_nodelay(fd)) {
+        close(fd);
         return false;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]