Skip to content

Commit

Permalink
sched/pthread: fix memory leak of pthread_tcb_s
Browse files Browse the repository at this point in the history
pthread tcb should be released appropriately

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao authored and xiaoxiang781216 committed Mar 6, 2024
1 parent 09960c5 commit 89bd6ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sched/pthread/pthread_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
return ENOMEM;
}

ptcb->cmn.flags |= TCB_FLAG_FREE_TCB;

/* Bind the parent's group to the new TCB (we have not yet joined the
* group).
*/
Expand Down

0 comments on commit 89bd6ab

Please sign in to comment.