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>
staging
parent
f47a47e458
commit
ab36edcfea
|
@ -110,6 +110,7 @@ static int vhost_vdpa_add(NetClientState *ncs, void *be)
|
||||||
err:
|
err:
|
||||||
if (net) {
|
if (net) {
|
||||||
vhost_net_cleanup(net);
|
vhost_net_cleanup(net);
|
||||||
|
g_free(net);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue