[Spice-devel] [PATCH vdagent-linux] vdagent-virtio-port: close socket on error

Alon Levy alevy at redhat.com
Tue Sep 3 03:07:20 PDT 2013


Signed-off-by: Alon Levy <alevy at redhat.com>
---
 src/vdagent-virtio-port.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/vdagent-virtio-port.c b/src/vdagent-virtio-port.c
index bdd22d9..bacfa42 100644
--- a/src/vdagent-virtio-port.c
+++ b/src/vdagent-virtio-port.c
@@ -116,6 +116,9 @@ struct vdagent_virtio_port *vdagent_virtio_port_create(const char *portname,
 
 error:
     syslog(LOG_ERR, "open %s: %m", portname);
+    if (vport->fd != -1) {
+        close(vport->fd);
+    }
     free(vport);
     return NULL;
 }
-- 
1.8.3.1



More information about the Spice-devel mailing list