usb_blaster_device_desc was allocated, but never freed.
Change-Id: I764bd092c71b8c260b98aab0e7a1710fd7bfa9fd
Signed-off-by: Stefan Mahr <stefan.mahr@sphairon.com>
Reviewed-on: http://openocd.zylin.com/1224
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: jenkins
if (usb_blaster_device_desc == NULL) {
LOG_WARNING("no usb_blaster device description specified, "
"using default 'USB-Blaster'");
- usb_blaster_device_desc = "USB-Blaster";
+ usb_blaster_device_desc = strdup("USB-Blaster");
}
#if IS_WIN32 == 0
ftdi_deinit(&ftdic);
#endif
+ if (usb_blaster_device_desc) {
+ free(usb_blaster_device_desc);
+ usb_blaster_device_desc = NULL;
+ }
+
return ERROR_OK;
}