bmp_libusb: Fix CMSIS-DAP related memory leak.
This commit is contained in:
parent
8845a22226
commit
80064c18a9
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue