From ab36edcfeaa292ca4c49c7ebb505f122ef06f9cc Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Fri, 3 Sep 2021 17:10:18 +0800 Subject: [PATCH] vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add() Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") Reviewed-by: Stefano Garzarella Signed-off-by: Jason Wang Message-Id: <20210903091031.47303-9-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 3213e69d63..b43df00a85 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -110,6 +110,7 @@ static int vhost_vdpa_add(NetClientState *ncs, void *be) err: if (net) { vhost_net_cleanup(net); + g_free(net); } return -1; }