jtag/drivers/ulink: fix clang static analyzer warning

scan-build-9:
Description: Potential leak of memory pointed to by 'tdo_buffer'
File: src/jtag/drivers/ulink.c
Line: 1629

Free the buffer before error return.

Change-Id: Ic47651a5ae78c7a47ae4fcbad225f329b14c45cb
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5519
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
This commit is contained in:
Tomas Vanek 2019-12-20 23:34:19 +01:00 committed by Oleksij Rempel
parent 46f077aa00
commit c064440162
1 changed files with 1 additions and 0 deletions

View File

@ -1627,6 +1627,7 @@ int ulink_queue_scan(struct ulink *device, struct jtag_command *cmd)
if (ret != ERROR_OK) {
free(tdi_buffer_start);
free(tdo_buffer_start);
return ret;
}
}