mirror of
https://github.com/Pithikos/C-Thread-Pool
synced 2024-11-25 06:49:37 +03:00
Fixed wrong check for malloc result, as found with cppcheck
This commit is contained in:
parent
430251cb65
commit
35a6d7427b
2
thpool.c
2
thpool.c
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user