summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pthreadpool/pthreadpool_tevent.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/pthreadpool/pthreadpool_tevent.c b/lib/pthreadpool/pthreadpool_tevent.c
index db6d4b2f2e8..0e890cb7ce5 100644
--- a/lib/pthreadpool/pthreadpool_tevent.c
+++ b/lib/pthreadpool/pthreadpool_tevent.c
@@ -301,6 +301,15 @@ struct tevent_req *pthreadpool_tevent_job_send(
state->fn = fn;
state->private_data = private_data;
+ if (pool == NULL) {
+ tevent_req_error(req, EINVAL);
+ return tevent_req_post(req, ev);
+ }
+ if (pool->pool == NULL) {
+ tevent_req_error(req, EINVAL);
+ return tevent_req_post(req, ev);
+ }
+
state->im = tevent_create_immediate(state);
if (tevent_req_nomem(state->im, req)) {
return tevent_req_post(req, ev);