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

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

 



Signed-off-by: Alon Levy <alevy@xxxxxxxxxx>
---
 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

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]