Skip to content

Commit

Permalink
Fix warning at line 285.
Browse files Browse the repository at this point in the history
It may can’t catch the malloc error.
  • Loading branch information
RhythmLian authored Nov 22, 2019
1 parent 430251c commit 71f5bc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion thpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int thpool_num_threads_working(thpool_* thpool_p){
static int thread_init (thpool_* thpool_p, struct thread** thread_p, int id){

*thread_p = (struct thread*)malloc(sizeof(struct thread));
if (thread_p == NULL){
if (*thread_p == NULL){
err("thread_init(): Could not allocate memory for thread\n");
return -1;
}
Expand Down

0 comments on commit 71f5bc9

Please sign in to comment.