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

Submitted by Gerd Hoffmann on June 21, 2013, 10:38 a.m.

Details

Message ID 1371811105-730-14-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

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

Patch hide | download patch | download mbox

diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 7776016..29a3564 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -971,7 +971,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;