From efafcdc6e96d370589914a7a55b46240a9056821 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Fri, 8 May 2026 07:57:26 +0000 Subject: [PATCH] fix leak of lock --- src/controller/job.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; }