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

Avoid srun segv on job allocate failure

If a job allocation returns some invalid contents, the pointer
  to the job structure may be NULL. This change preserves the error
  message and avoids a segv.
parent 44bb06bc
No related branches found
No related tags found
No related merge requests found
...@@ -404,9 +404,11 @@ job_create_allocation(resource_allocation_response_msg_t *resp) ...@@ -404,9 +404,11 @@ job_create_allocation(resource_allocation_response_msg_t *resp)
i->select_jobinfo = select_g_select_jobinfo_copy(resp->select_jobinfo); i->select_jobinfo = select_g_select_jobinfo_copy(resp->select_jobinfo);
job = _job_create_structure(i); job = _job_create_structure(i);
job->account = xstrdup(resp->account); if (job) {
job->qos = xstrdup(resp->qos); job->account = xstrdup(resp->account);
job->resv_name = xstrdup(resp->resv_name); job->qos = xstrdup(resp->qos);
job->resv_name = xstrdup(resp->resv_name);
}
xfree(i->nodelist); xfree(i->nodelist);
xfree(i); xfree(i);
......
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