panda: fix dev_list may be freed twice on failure (#22161)

This commit is contained in:
Dean Lee
2021-09-08 06:12:38 +08:00
committed by GitHub
parent 1c750975fc
commit 83cd67ddb5
+1
View File
@@ -59,6 +59,7 @@ Panda::Panda(std::string serial) {
}
if (dev_handle == NULL) goto fail;
libusb_free_device_list(dev_list, 1);
dev_list = nullptr;
if (libusb_kernel_driver_active(dev_handle, 0) == 1) {
libusb_detach_kernel_driver(dev_handle, 0);