bmp_libusb: Fix CMSIS-DAP related memory leak.

This commit is contained in:
Uwe Bonnes 2021-10-30 13:56:11 +02:00
parent 8845a22226
commit 80064c18a9
1 changed files with 3 additions and 2 deletions

View File

@ -68,6 +68,7 @@ static bmp_type_t find_cmsis_dap_interface(libusb_device *dev,bmp_info_t *info)
if (res != LIBUSB_SUCCESS) { if (res != LIBUSB_SUCCESS) {
DEBUG_INFO("INFO: libusb_open() failed: %s\n", DEBUG_INFO("INFO: libusb_open() failed: %s\n",
libusb_strerror(res)); libusb_strerror(res));
libusb_free_config_descriptor(conf);
return type; return type;
} }
@ -110,10 +111,10 @@ static bmp_type_t find_cmsis_dap_interface(libusb_device *dev,bmp_info_t *info)
} }
/* V2 is preferred, return early. */ /* V2 is preferred, return early. */
return type; break;
} }
} }
libusb_free_config_descriptor(conf);
return type; return type;
} }