Fix warning at line 285.

It may can’t catch the malloc error.
This commit is contained in:
RhythmLian 2019-11-22 08:23:27 +08:00 committed by GitHub
parent 430251cb65
commit 71f5bc9613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}