vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add()

Fixes: 1e0a84ea49 ("vhost-vdpa: introduce vhost-vdpa net client")
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20210903091031.47303-9-jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Jason Wang 2021-09-03 17:10:18 +08:00 committed by Michael S. Tsirkin
parent f47a47e458
commit ab36edcfea
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}