[Spice-devel] [PATCH] udscs: Avoid file descriptor leak
Frediano Ziglio
fziglio at redhat.com
Thu Nov 15 22:06:57 UTC 2018
If connection fails the socket descriptor is not closed causing
a leak.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
src/udscs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/udscs.c b/src/udscs.c
index 62abc97..7fe74b9 100644
--- a/src/udscs.c
+++ b/src/udscs.c
@@ -119,6 +119,7 @@ struct udscs_connection *udscs_connect(const char *socketname,
if (conn->debug) {
syslog(LOG_DEBUG, "connect %s: %m", socketname);
}
+ close(conn->fd);
g_free(conn);
return NULL;
}
--
2.17.2
More information about the Spice-devel
mailing list