Fix USB device leak on connection error

If sc_usb_connect() failed, then the sc_usb_device was never destroyed.

The assignment was mistakenly removed by commit
61969aeb80.
This commit is contained in:
Romain Vimont 2022-02-10 08:46:14 +01:00
parent 8d583d36e2
commit 43ae418752

View file

@ -89,6 +89,8 @@ scrcpy_otg(struct scrcpy_options *options) {
goto end; goto end;
} }
usb_device_initialized = true;
LOGI("USB device: %s (%04" PRIx16 ":%04" PRIx16 ") %s %s", LOGI("USB device: %s (%04" PRIx16 ":%04" PRIx16 ") %s %s",
usb_device.serial, usb_device.vid, usb_device.pid, usb_device.serial, usb_device.vid, usb_device.pid,
usb_device.manufacturer, usb_device.product); usb_device.manufacturer, usb_device.product);