From: linzhecheng Date: Tue, 13 Feb 2018 05:08:37 +0000 (+0800) Subject: vhost-user: fix memory leak X-Git-Tag: v2.12.0-rc0~60^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a38a498dc1dc2d101a4958b6bfbf921df478c069;p=thirdparty%2Fqemu.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 cb455125069..d024573e45f 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;