Patchwork [v2,13/13] qemu-socket: don't leak opts on error

login
register
mail settings
Submitter Gerd Hoffmann
Date June 24, 2013, 6:39 a.m.
Message ID <1372055996-4072-14-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/253643/
State New
Headers show

Comments

Gerd Hoffmann - June 24, 2013, 6:39 a.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 util/qemu-sockets.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 126cbb6..095716e 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -963,7 +963,7 @@  int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)
 
     default:
         error_setg(errp, "socket type unsupported for datagram");
-        return -1;
+        fd = -1;
     }
     qemu_opts_del(opts);
     return fd;