diff --git a/src/plugins/slurmctld/nonstop/do_work.c b/src/plugins/slurmctld/nonstop/do_work.c index 42b55b1bc9013aed1888ad201ff7e061f28e1f27..529d95100bf586dbabffabe06644d1d6bf22cb79 100644 --- a/src/plugins/slurmctld/nonstop/do_work.c +++ b/src/plugins/slurmctld/nonstop/do_work.c @@ -1345,6 +1345,16 @@ extern char *replace_node(char *cmd_ptr, uid_t cmd_uid, if (i == SLURM_SUCCESS) will_run_time = will_run_idle; } + xfree(job_alloc_req.account); + xfree(job_alloc_req.dependency); + xfree(job_alloc_req.exc_nodes); + xfree(job_alloc_req.features); + xfree(job_alloc_req.gres); + xfree(job_alloc_req.name); + xfree(job_alloc_req.network); + xfree(job_alloc_req.partition); + xfree(job_alloc_req.qos); + xfree(job_alloc_req.wckey); pthread_mutex_lock(&job_fail_mutex); /* Resume lock */ @@ -1375,18 +1385,6 @@ extern char *replace_node(char *cmd_ptr, uid_t cmd_uid, goto fini; } - xfree(job_alloc_req.account); - xfree(job_alloc_req.dependency); - xfree(job_alloc_req.exc_nodes); - xfree(job_alloc_req.features); - xfree(job_alloc_req.gres); - xfree(job_alloc_req.name); - xfree(job_alloc_req.network); - xfree(job_alloc_req.partition); - xfree(job_alloc_req.qos); - xfree(job_alloc_req.reservation); - xfree(job_alloc_req.wckey); - merge: if (!new_job_ptr) { /* Fix for CLANG false positive */ error("%s: New job is NULL", __func__);