]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vhost-user: fix memory leak
authorlinzhecheng <linzhecheng@huawei.com>
Tue, 13 Feb 2018 05:08:37 +0000 (13:08 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Mar 2018 14:05:26 +0000 (16:05 +0200)
g_free() was moved from vhost_net_cleanup in commit e6bcb1b, so we should
free net after vhost_net_cleanup

Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Reviewed-by: Marc-André Lureau < marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
net/vhost-user.c

index cb455125069c4047d0183188dcc791327d6d9f66..d024573e45f6895a3e093b69a5ff494516b8bd14 100644 (file)
@@ -109,6 +109,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], CharBackend *be)
 err:
     if (net) {
         vhost_net_cleanup(net);
+        g_free(net);
     }
     vhost_user_stop(i, ncs);
     return -1;