target: Replace malloc+manual zeroing with calloc 67/3667/2
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sat, 13 Aug 2016 08:42:30 +0000 (10:42 +0200)
committerPaul Fertser <fercerpav@gmail.com>
Thu, 8 Dec 2016 14:59:40 +0000 (14:59 +0000)
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>
src/target/target.c

index 17902a51c8ac7c46d54d707c82f3e0d1faaf547f..c8a3ce4d8e8288d3c1168889249d2c0903b8a25a 100644 (file)
@@ -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;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)