X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Frtos%2FThreadX.c;h=add34b4f4db8b2c2da8cb3dd0032e8d74317422c;hp=19dc46360220a113cf96ee8bc6cc270ef4774a54;hb=refs%2Fchanges%2F16%2F1916%2F8;hpb=bc1340cf0b9aa28c03d1b07c54b6e0bf4a483351 diff --git a/src/rtos/ThreadX.c b/src/rtos/ThreadX.c index 19dc463602..add34b4f4d 100644 --- a/src/rtos/ThreadX.c +++ b/src/rtos/ThreadX.c @@ -155,25 +155,7 @@ static int ThreadX_update_threads(struct rtos *rtos) } /* wipe out previous thread details if any */ - if (rtos->thread_details != NULL) { - int j; - for (j = 0; j < rtos->thread_count; j++) { - if (rtos->thread_details[j].display_str != NULL) { - free(rtos->thread_details[j].display_str); - rtos->thread_details[j].display_str = NULL; - } - if (rtos->thread_details[j].thread_name_str != NULL) { - free(rtos->thread_details[j].thread_name_str); - rtos->thread_details[j].thread_name_str = NULL; - } - if (rtos->thread_details[j].extra_info_str != NULL) { - free(rtos->thread_details[j].extra_info_str); - rtos->thread_details[j].extra_info_str = NULL; - } - } - free(rtos->thread_details); - rtos->thread_details = NULL; - } + rtos_free_threadlist(rtos); /* read the current thread id */ retval = target_read_buffer(rtos->target,