diff --git a/src/controller/job.c b/src/controller/job.c index 325ce42d..d9082ea7 100644 --- a/src/controller/job.c +++ b/src/controller/job.c @@ -239,6 +239,11 @@ static int dispatch_a_job_(cluster_t* c, endpoint_t* ep, xce_job_alloc_t* alloc) rc = get_queue_exec(c, j->job.submit->queue, &q_pre_exec, &q_post_exec); if (rc < 0) { + unlock(w); + dereference(w); + dereference(j); + free_launchinfo(&launchinfo); + return rc; } @@ -322,6 +327,9 @@ int job_ctrl(cluster_t* c, xce_jobctrl_t* ctrinfo) unlock(c->workermgr); if (rc < 0) { + unlock(j); + dereference(j); + return rc; } if (w != NULL) { @@ -917,6 +925,8 @@ int update_job_rusages(cluster_t* c, endpoint_t* ep, xce_request_t* request) w = get_ep_worker(c, ep); if (w == NULL) { + dereference(j); + return errno; }