xsvf: fix memory leak

Discovered by clang static analyzer.

Change-Id: I2980586aea5ee43226adb1f4cf72e7ba1dfddd83
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5372
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
This commit is contained in:
Tomas Vanek 2019-12-20 23:38:42 +01:00
parent 251eb035fc
commit 35d9bf9917
1 changed files with 3 additions and 1 deletions

View File

@ -918,8 +918,10 @@ COMMAND_HANDLER(handle_xsvf_command)
struct scan_field field;
result = svf_add_statemove(loop_state);
if (result != ERROR_OK)
if (result != ERROR_OK) {
free(dr_in_mask);
return result;
}
jtag_add_clocks(loop_clocks);
jtag_add_sleep(loop_usecs);