openocd: avoid checking for non NULL pointer to free it
[openocd.git] / src / rtos / linux.c
index cd1ed218abfb996f712e04f534acc42a3f670e84..dbbf97b4467ae2a3de26c6345b7cb6783a97b288 100644 (file)
@@ -627,8 +627,7 @@ struct threads *liste_del_task(struct threads *task_list, struct threads **t,
                task_list = (*t)->next;
 
        /*  free content of threads */
-       if ((*t)->context)
-               free((*t)->context);
+       free((*t)->context);
 
        free(*t);
        *t = prev ? prev : task_list;
@@ -781,8 +780,7 @@ static int clean_threadlist(struct target *target)
        while (temp != NULL) {
                old = temp;
 
-               if (temp->context)
-                       free(temp->context);
+               free(temp->context);
 
                temp = temp->next;
                free(old);
@@ -931,10 +929,8 @@ static int linux_task_update(struct target *target, int context)
        while (thread_list != NULL) {
                thread_list->status = 0;        /*setting all tasks to dead state*/
 
-               if (thread_list->context) {
-                       free(thread_list->context);
-                       thread_list->context = NULL;
-               }
+               free(thread_list->context);
+               thread_list->context = NULL;
 
                thread_list = thread_list->next;
        }

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)