Fixed wrong check for malloc result, as found with cppcheck

This commit is contained in:
Erik Janssen 2018-12-06 21:35:50 +01:00
parent 430251cb65
commit 35a6d7427b
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;
}