diff options
author | Liviu Ionescu <ilg@livius.net> | 2018-06-05 17:34:47 +0300 |
---|---|---|
committer | Matthias Welwarsky <matthias@welwarsky.de> | 2018-06-06 15:22:51 +0100 |
commit | 7028f53877dad35a6aca58349160642bccbc9c83 (patch) | |
tree | 503a63c2c38e855de5468215d010c261a58143f3 /src | |
parent | ebf2d733409e140cb220d95eb3a915fed14d69a4 (diff) | |
download | riscv-openocd-7028f53877dad35a6aca58349160642bccbc9c83.zip riscv-openocd-7028f53877dad35a6aca58349160642bccbc9c83.tar.gz riscv-openocd-7028f53877dad35a6aca58349160642bccbc9c83.tar.bz2 |
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 <ilg@livius.net>
Reviewed-on: http://openocd.zylin.com/4552
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/target.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/target/target.c b/src/target/target.c index c9b2006..7ab13b0 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; |