vhost-user: delete net client if necessary

As qemu_new_net_client create new ncs but error happens later,
ncs will be left in global net_clients list and we can't use them any
more, so we need to cleanup them.

Cc: qemu-stable@nongnu.org
Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
linzhecheng 2018-06-12 10:24:45 +08:00 committed by Jason Wang
parent 2285a00c11
commit c67daf4a24

View File

@ -345,6 +345,9 @@ err:
s->vhost_user = NULL;
}
}
if (nc0) {
qemu_del_net_client(nc0);
}
return -1;
}