summaryrefslogtreecommitdiffstats
path: root/net/vhost-user.c
diff options
context:
space:
mode:
authorlinzhecheng2018-02-13 06:08:37 +0100
committerMichael S. Tsirkin2018-03-01 15:05:26 +0100
commita38a498dc1dc2d101a4958b6bfbf921df478c069 (patch)
tree4549b18286f610ca41afd26630b16948212570ba /net/vhost-user.c
parentMerge remote-tracking branch 'remotes/famz/tags/staging-pull-request' into st... (diff)
downloadqemu-a38a498dc1dc2d101a4958b6bfbf921df478c069.tar.gz
qemu-a38a498dc1dc2d101a4958b6bfbf921df478c069.tar.xz
qemu-a38a498dc1dc2d101a4958b6bfbf921df478c069.zip
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 <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>
Diffstat (limited to 'net/vhost-user.c')
-rw-r--r--net/vhost-user.c1
1 files changed, 1 insertions, 0 deletions
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;