jtag: usb_blaster: fix allocation of usb_blaster_device_desc
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
This commit is contained in:
parent
fac9057f02
commit
30fde70c03
|
@ -338,7 +338,7 @@ static int usb_blaster_init(void)
|
|||
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
|
||||
|
@ -469,6 +469,11 @@ static int usb_blaster_quit(void)
|
|||
ftdi_deinit(&ftdic);
|
||||
#endif
|
||||
|
||||
if (usb_blaster_device_desc) {
|
||||
free(usb_blaster_device_desc);
|
||||
usb_blaster_device_desc = NULL;
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue