This is a  finding from coverity. In practice it has very little impact
since returning NULL from this function results in the process existing
with an error.

Signed-off-by: Jonathon Jongsma <jjong...@redhat.com>
---
 src/udscs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/udscs.c b/src/udscs.c
index 64f0307..6e73015 100644
--- a/src/udscs.c
+++ b/src/udscs.c
@@ -450,12 +450,14 @@ struct udscs_server *udscs_create_server(const char 
*socketname,
     c = bind(fd, (struct sockaddr *)&address, sizeof(address));
     if (c != 0) {
         syslog(LOG_ERR, "bind %s: %m", socketname);
+        close(fd);
         return NULL;
     }
 
     c = listen(fd, 5);
     if (c != 0) {
         syslog(LOG_ERR, "listen: %m");
+        close(fd);
         return NULL;
     }
 
-- 
2.13.6

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to