usb: free leaking path

qdev_get_dev_path() returns an allocated string, free it when no longer
needed.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Marc-André Lureau 2016-07-15 11:48:13 +02:00
parent ec507f1123
commit 9ef617246b
1 changed files with 1 additions and 0 deletions

View File

@ -574,6 +574,7 @@ void usb_desc_create_serial(USBDevice *dev)
}
dst += snprintf(serial+dst, sizeof(serial)-dst, "-%s", dev->port->path);
usb_desc_set_string(dev, index, serial);
g_free(path);
}
const char *usb_desc_get_string(USBDevice *dev, uint8_t index)