render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame 0218-qemu-sockets-Fix-potential-memory-leak.patch

5544c1
From 46193407875faf8a8be20dabc4ecfee4ceb6f1a3 Mon Sep 17 00:00:00 2001
5544c1
From: Stefan Weil <sw@weilnetz.de>
5544c1
Date: Sat, 1 Sep 2012 09:40:26 +0200
5544c1
Subject: [PATCH] qemu-sockets: Fix potential memory leak
5544c1
5544c1
The old code leaks variable 'peer'.
5544c1
5544c1
Signed-off-by: Stefan Weil <sw@weilnetz.de>
5544c1
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
5544c1
(cherry picked from commit 39b384591fda27d6e1213cea0b11b1ebe0ed4b74)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 qemu-sockets.c | 2 +-
5544c1
 1 file changed, 1 insertion(+), 1 deletion(-)
5544c1
5544c1
diff --git a/qemu-sockets.c b/qemu-sockets.c
5544c1
index 361d890..037775b 100644
5544c1
--- a/qemu-sockets.c
5544c1
+++ b/qemu-sockets.c
5544c1
@@ -353,7 +353,7 @@ int inet_dgram_opts(QemuOpts *opts)
5544c1
     if (0 != (rc = getaddrinfo(addr, port, &ai, &local))) {
5544c1
         fprintf(stderr,"getaddrinfo(%s,%s): %s\n", addr, port,
5544c1
                 gai_strerror(rc));
5544c1
-        return -1;
5544c1
+        goto err;
5544c1
     }
5544c1
 
5544c1
     /* create socket */
5544c1
-- 
5544c1
1.7.12.1
5544c1