fix: remove double-free of libusb device list in EBUSY path

The device list 'devs' is already freed at line 165 after the for-loop.
The second free inside the LIBUSB_ERROR_BUSY block corrupts the heap,
especially on WSL where a stale claimed interface from a previous run
triggers this path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Moussa Ouallaf 2026-09-19 12:27:46 +02:00
parent 55769a8d1c
commit 208ecfec9e

View file

@ -194,7 +194,6 @@ int usb_dfu_find(libusb_device_handle **handle, uint8_t *iserial_out)
}
/* The caller (checkm8_exploit / usb_dfu_find retry) will call
* usb_dfu_find again after returning error. */
libusb_free_device_list(devs, 1);
return -1;
}
if (ret != LIBUSB_SUCCESS)