From 208ecfec9ef21ac7f4be6fda06b1a4558c85e0fb Mon Sep 17 00:00:00 2001 From: Moussa Ouallaf Date: Sat, 19 Sep 2026 12:27:46 +0200 Subject: [PATCH] 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 --- src/device/usb_dfu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/device/usb_dfu.c b/src/device/usb_dfu.c index 5e0a4e6..89bd477 100644 --- a/src/device/usb_dfu.c +++ b/src/device/usb_dfu.c @@ -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)