jtag/core, target: unregister JTAG events

Also call adapter_exit() before command_exit() as the latter releases
Jim interpreter so JTAG events should be released before.

Fixes memory leak reported by valgrind

Change-Id: I493f3fcba34ea2b4234148e79a4e329c866e0f05
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4474
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
This commit is contained in:
Tomas Vanek
2018-03-22 00:20:15 +01:00
committed by Matthias Welwarsky
parent 37deb37593
commit 6eba3777fc
3 changed files with 12 additions and 2 deletions

View File

@@ -359,11 +359,11 @@ int openocd_main(int argc, char *argv[])
unregister_all_commands(cmd_ctx, NULL);
adapter_quit();
/* Shutdown commandline interface */
command_exit(cmd_ctx);
adapter_quit();
free_config();
if (ERROR_FAIL == ret)