when failing to attach another usb device to a domain for some reason
which has one use device attached before, the libvirtd crashed.
The crash is caused by null-pointer dereference error in invoking
usbDeviceListSteal passed in NULL value usb variable.
commit
05abd1507d66aabb6cad12eeafeb4c4d1911c585 introduces the bug.
cleanup:
usbDeviceListFree(list);
- usbDeviceListSteal(driver->activeUsbHostdevs, usb);
+ if (usb)
+ usbDeviceListSteal(driver->activeUsbHostdevs, usb);
return -1;
}