ipdbg: fix 'double free' in case of failed start

Change-Id: Id241d9dd0793095106fea000422617fbef462669
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7770
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
Daniel Anselmi 2023-07-10 21:03:10 +02:00 committed by Antonio Borneo
parent 05da04acda
commit 965730dda9
1 changed files with 1 additions and 3 deletions

View File

@ -632,10 +632,8 @@ static int ipdbg_start(uint16_t port, struct jtag_tap *tap, uint32_t user_instru
}
} else {
int retval = ipdbg_create_hub(tap, user_instruction, data_register_length, virtual_ir, &hub);
if (retval != ERROR_OK) {
free(virtual_ir);
if (retval != ERROR_OK)
return retval;
}
}
struct ipdbg_service *service = NULL;