aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2016-08-13 10:42:30 +0200
committerPaul Fertser <fercerpav@gmail.com>2016-12-08 14:59:40 +0000
commit50e2253ab9433e5ff2d01a7338477a44e7cf8a6f (patch)
tree5a101ddb57685341adf103d8b2516a67985e1809
parent44f21c9d4362e479158d0852bc16c0cde5d5b53d (diff)
target: Replace malloc+manual zeroing with calloc
Change-Id: I3c782c34b59cb36b8ca1d36e9c804c67bae5cb45 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3667 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
-rw-r--r--src/target/target.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 17902a51..c8a3ce4d 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5408,14 +5408,7 @@ static int target_create(Jim_GetOptInfo *goi)
target->halt_issued = false;
/* initialize trace information */
- target->trace_info = malloc(sizeof(struct trace));
- target->trace_info->num_trace_points = 0;
- target->trace_info->trace_points_size = 0;
- target->trace_info->trace_points = NULL;
- target->trace_info->trace_history_size = 0;
- target->trace_info->trace_history = NULL;
- target->trace_info->trace_history_pos = 0;
- target->trace_info->trace_history_overflowed = 0;
+ target->trace_info = calloc(1, sizeof(struct trace));
target->dbgmsg = NULL;
target->dbg_msg_enabled = 0;