X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Frtos%2FThreadX.c;h=fb9f5f7d916affd62774b532805ecb2c4d60bd21;hb=1d7176f50bc7d5971a82977ac2baa79eef521c21;hp=88470b62ff198c6a83ace509a08286bbc41edb23;hpb=03410e92dae6efbb2dc474fb7556117cc60c3f82;p=openocd.git diff --git a/src/rtos/ThreadX.c b/src/rtos/ThreadX.c index 88470b62ff..fb9f5f7d91 100644 --- a/src/rtos/ThreadX.c +++ b/src/rtos/ThreadX.c @@ -330,8 +330,8 @@ static int ThreadX_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, cha static int ThreadX_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]) { unsigned int i; - *symbol_list = malloc( - sizeof(symbol_table_elem_t) * ARRAY_SIZE(ThreadX_symbol_list)); + *symbol_list = calloc( + ARRAY_SIZE(ThreadX_symbol_list), sizeof(symbol_table_elem_t)); for (i = 0; i < ARRAY_SIZE(ThreadX_symbol_list); i++) (*symbol_list)[i].symbol_name = ThreadX_symbol_list[i];