jtag/adapter: fix memory leak on usb location

At exit, free the memory allocated to hold the USB location.

Change-Id: I050701f4dc8be14fd40e8add9d0b047461fa0d1c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6646
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
This commit is contained in:
Antonio Borneo 2021-10-07 18:13:21 +02:00
parent ac1a632ba1
commit e9a569aa18
1 changed files with 2 additions and 0 deletions

View File

@ -120,6 +120,8 @@ int adapter_quit(void)
LOG_ERROR("failed: %d", result);
}
free(adapter_config.usb_location);
struct jtag_tap *t = jtag_all_taps();
while (t) {
struct jtag_tap *n = t->next_tap;