[Spice-devel] [server PATCH 1/4] reds_init_socket: do not leak slisten on error
Uri Lublin
uril at redhat.com
Sun Dec 10 11:05:16 UTC 2017
Found by coverity.
Signed-off-by: Uri Lublin <uril at redhat.com>
---
server/reds.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/server/reds.c b/server/reds.c
index 325af5e8b..e7b95980a 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2588,6 +2588,7 @@ static int reds_init_socket(const char *addr, int portnr, int family)
len = SUN_LEN(&local);
if (bind(slisten, (struct sockaddr *)&local, len) == -1) {
perror("bind");
+ close(slisten);
return -1;
}
--
2.14.3
More information about the Spice-devel
mailing list