qemu-sockets: use qapi_free_SocketAddress in cleanup
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 6 Jul 2016 16:42:46 +0000 (18:42 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Jul 2016 16:31:27 +0000 (18:31 +0200)
Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that
may leak some linked data.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20160706164246.22116-1-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
util/qemu-sockets.c

index fb83d489449cff2ebe290e9dc7c3e34a9f206988..777af49d53cd759e2445539fcf6dd27a342baf16 100644 (file)
@@ -1012,7 +1012,7 @@ void socket_listen_cleanup(int fd, Error **errp)
         }
     }
 
-    g_free(addr);
+    qapi_free_SocketAddress(addr);
 }
 
 int socket_dgram(SocketAddress *remote, SocketAddress *local, Error **errp)