diff options
author | Alon Levy <alevy@redhat.com> | 2013-09-03 13:06:56 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2013-09-03 13:06:56 +0300 |
commit | 8ec5ba92c3f967469b6679e9cf3212110a7becba (patch) | |
tree | f9cfab096a4778311b3a56c9f9bede72bb93767d | |
parent | 21175d0701a8e8d838a8ec18690ef39620fef875 (diff) | |
download | vd_agent-8ec5ba92c3f967469b6679e9cf3212110a7becba.tar.gz vd_agent-8ec5ba92c3f967469b6679e9cf3212110a7becba.tar.xz vd_agent-8ec5ba92c3f967469b6679e9cf3212110a7becba.zip |
vdagent-virtio-port: close socket on error
Signed-off-by: Alon Levy <alevy@redhat.com>
-rw-r--r-- | src/vdagent-virtio-port.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; } |