From 8efd3adc8ae70ecea387ec5dfea9db04c1aaf1aa Mon Sep 17 00:00:00 2001 From: thebaron06 Date: Wed, 15 Mar 2017 12:58:37 +0100 Subject: [PATCH] Fix possible memory leak (#571) fixes #570 --- src/usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/usb.c b/src/usb.c index 4b57ed98f..03ac1ab3c 100644 --- a/src/usb.c +++ b/src/usb.c @@ -855,6 +855,7 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, bool reset, char serial[16 if (ret != 0) { WLOG("Error %d (%s) opening ST-Link/V2 device %03d:%03d\n", ret, strerror (errno), libusb_get_bus_number(list[cnt]), libusb_get_device_address(list[cnt])); + libusb_free_device_list(list, 1); goto on_error; } }