From: Liviu Ionescu Date: Tue, 5 Jun 2018 14:34:47 +0000 (+0300) Subject: target/target.c: free semihosting member X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7028f53877dad35a6aca58349160642bccbc9c83;p=openocd target/target.c: free semihosting member When destroying the target, if the semihosting pointer is set, free it. Change-Id: I07d34918bb3fddab1eee11219dd66f4842708ec1 Signed-off-by: Liviu Ionescu Reviewed-on: http://openocd.zylin.com/4552 Tested-by: jenkins Reviewed-by: Tomas Vanek --- diff --git a/src/target/target.c b/src/target/target.c index c9b20063..7ab13b02 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1893,6 +1893,9 @@ static void target_destroy(struct target *target) if (target->type->deinit_target) target->type->deinit_target(target); + if (target->semihosting) + free(target->semihosting); + jtag_unregister_event_callback(jtag_enable_callback, target); struct target_event_action *teap = target->event_action;