Skip to content
Snippets Groups Projects
Commit b8d37be2 authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Fix minor memory leak when user is the slurm user or root

parent 9206c7cd
No related branches found
No related tags found
No related merge requests found
...@@ -306,20 +306,24 @@ _check_job_credential(slurm_cred_t cred, uint32_t jobid, ...@@ -306,20 +306,24 @@ _check_job_credential(slurm_cred_t cred, uint32_t jobid,
slurm_cred_arg_t arg; slurm_cred_arg_t arg;
hostset_t hset = NULL; hostset_t hset = NULL;
bool user_ok = _slurm_authorized_user(uid); bool user_ok = _slurm_authorized_user(uid);
int rc;
/* /*
* First call slurm_cred_verify() so that all valid * First call slurm_cred_verify() so that all valid
* credentials are checked * credentials are checked
*/ */
if ((slurm_cred_verify(conf->vctx, cred, &arg) < 0) && !user_ok) if (((rc = slurm_cred_verify(conf->vctx, cred, &arg)) < 0) && !user_ok)
return SLURM_ERROR; return SLURM_ERROR;
/* /*
* If uid is the slurm user id or root, do not bother * If uid is the slurm user id or root, do not bother
* performing validity check of the credential * performing validity check of the credential
*/ */
if (user_ok) if (user_ok) {
if (rc >= 0)
xfree(arg.hostlist);
return SLURM_SUCCESS; return SLURM_SUCCESS;
}
if ((arg.jobid != jobid) || (arg.stepid != stepid)) { if ((arg.jobid != jobid) || (arg.stepid != stepid)) {
error("job credential for %d.%d, expected %d.%d", error("job credential for %d.%d, expected %d.%d",
......
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