forked from auracaster/openocd
target/arm7tdmi: fix memory leak of register cache
There is no method to free the register cache, allocated in arm7tdmi_init_target(), so we get a memory leak. Issue identified by tracking all calls to arm_build_reg_cache(). Implement the method arm7tdmi_deinit_target() that in turn calls arm7tdmi_free_reg_cache(). NOT TESTED on a real arm7tdmi target. Tested on a arm926ejs (SPEAr320) by hacking the target type and pretending it is a arm7tdmi: sed -i s/arm926ejs/arm7tdmi/ tcl/target/spear3xx.cfg Change-Id: Iad465b708eb4ebb298725d7155fea76357e9045c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5696 Tested-by: jenkins
This commit is contained in:
@@ -28,5 +28,6 @@ int arm7tdmi_init_arch_info(struct target *target,
|
||||
struct arm7_9_common *arm7_9, struct jtag_tap *tap);
|
||||
int arm7tdmi_init_target(struct command_context *cmd_ctx,
|
||||
struct target *target);
|
||||
void arm7tdmi_deinit_target(struct target *target);
|
||||
|
||||
#endif /* OPENOCD_TARGET_ARM7TDMI_H */
|
||||
|
||||
Reference in New Issue
Block a user