From: linzhecheng Date: Tue, 13 Feb 2018 05:08:37 +0000 (+0800) Subject: vhost-user: fix memory leak X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a38a498dc1dc2d101a4958b6bfbf921df478c069;p=qemu.git vhost-user: fix memory leak g_free() was moved from vhost_net_cleanup in commit e6bcb1b, so we should free net after vhost_net_cleanup Signed-off-by: linzhecheng Reviewed-by: Marc-André Lureau < marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé --- diff --git a/net/vhost-user.c b/net/vhost-user.c index cb45512506..d024573e45 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -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;