提交 ec507f11 编写于 作者: M Marc-André Lureau

usb: free USBDevice.strings

The list is created during instance init and further populated with
usb_desc_set_string(). Clear it when unrealizing the device.
Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
上级 0137a557
......@@ -279,6 +279,13 @@ static void usb_qdev_realize(DeviceState *qdev, Error **errp)
static void usb_qdev_unrealize(DeviceState *qdev, Error **errp)
{
USBDevice *dev = USB_DEVICE(qdev);
USBDescString *s, *next;
QLIST_FOREACH_SAFE(s, &dev->strings, next, next) {
QLIST_REMOVE(s, next);
g_free(s->str);
g_free(s);
}
if (dev->attached) {
usb_device_detach(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册