Commit 7ad11de2 authored by Tomas Vanek's avatar Tomas Vanek
Browse files

target/target: free what leaked in target_destroy()



Free event_action, fileio_info and working area.

Change-Id: Iac81230423e92304b8e2c971d0ec71a96b693fc4
Signed-off-by: default avatarTomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4412
Tested-by: jenkins
parent 63d76882
......@@ -1892,8 +1892,24 @@ static void target_destroy(struct target *target)
if (target->type->deinit_target)
target->type->deinit_target(target);
struct target_event_action *teap = target->event_action;
while (teap) {
struct target_event_action *next = teap->next;
Jim_DecrRefCount(teap->interp, teap->body);
free(teap);
teap = next;
}
target_free_all_working_areas(target);
/* Now we have none or only one working area marked as free */
if (target->working_areas) {
free(target->working_areas->backup);
free(target->working_areas);
}
free(target->type);
free(target->trace_info);
free(target->fileio_info);
free(target->cmd_name);
free(target);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment