Skip to content
Snippets Groups Projects
Commit 70f86051 authored by Morris Jette's avatar Morris Jette
Browse files

Log job not found, don't use NULL pointer

Coverity CID 44968
parent db233217
No related branches found
No related tags found
No related merge requests found
......@@ -616,12 +616,18 @@ static void _requeue_when_finished(uint32_t job_id)
while (1) {
lock_slurmctld(job_write_lock);
job_ptr = find_job_record(job_id);
if (IS_JOB_FINISHED(job_ptr)) {
if (!job_ptr) {
error("%s: Job %u not found", __func__, job_id);
unlock_slurmctld(job_write_lock);
break;
} else if (IS_JOB_FINISHED(job_ptr)) {
job_ptr->job_state = JOB_PENDING;
job_ptr->details->submit_time = time(NULL);
job_ptr->restart_cnt++;
/* Since the job completion logger
* removes the submit we need to add it again. */
/*
* Since the job completion logger
* removes the submit we need to add it again.
*/
acct_policy_add_job_submit(job_ptr);
unlock_slurmctld(job_write_lock);
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment