diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 62f51e7969..409d28841d 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1213,7 +1213,8 @@ error: cleanup: usbDeviceListFree(list); - usbDeviceListSteal(driver->activeUsbHostdevs, usb); + if (usb) + usbDeviceListSteal(driver->activeUsbHostdevs, usb); return -1; }