Skip to content

Commit

Permalink
add deref on error
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Feb 26, 2023
1 parent 7548723 commit 5dcf31d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/thread/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ int thread_create_name(thrd_t *thr, const char *name, thrd_start_t func,
if (ret == thrd_success)
return 0;

mem_deref(th);

if (ret == thrd_nomem)
return ENOMEM;

Expand Down

0 comments on commit 5dcf31d

Please sign in to comment.