added some (unlikely required) free()s

This commit is contained in:
Mario Lombardo 2015-06-26 17:00:45 +02:00
parent e472a4bf75
commit b58a5431d3
1 changed files with 3 additions and 0 deletions

View File

@ -143,6 +143,9 @@ struct thpool_* thpool_init(int num_threads){
thpool_p->threads = (struct thread**)malloc(num_threads * sizeof(struct thread));
if (thpool_p->threads == NULL){
fprintf(stderr, "thpool_init(): Could not allocate memory for threads\n");
jobqueue_destroy(thpool_p);
free(thpool_p->jobqueue_p);
free(thpool_p);
return NULL;
}