Skip to content
Snippets Groups Projects
Commit 188afc9e authored by Moe Jette's avatar Moe Jette
Browse files

Remove some redundant logic [ if (x) xfree(x); x=NULL; ]

and restructure some code to comply with linux kernel programming standard.
parent 0378b89b
No related branches found
No related tags found
No related merge requests found
......@@ -539,18 +539,17 @@ _check_job_credential(slurm_cred_t cred, uint32_t jobid,
hostset_destroy(hset);
xfree(arg.hostlist);
arg.ntask_cnt = 0;
if (arg.ntask) xfree(arg.ntask);
arg.ntask = NULL;
arg.ntask_cnt = 0;
xfree(arg.ntask);
return SLURM_SUCCESS;
fail:
if (hset) hostset_destroy(hset);
if (hset)
hostset_destroy(hset);
xfree(arg.hostlist);
arg.ntask_cnt = 0;
if (arg.ntask) xfree(arg.ntask);
arg.ntask = NULL;
xfree(arg.ntask);
slurm_seterrno_ret(ESLURMD_INVALID_JOB_CREDENTIAL);
}
......
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