From 188afc9e6c16ac27042c8c7fe99e95329232c4d0 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Mon, 24 Oct 2005 22:45:56 +0000
Subject: [PATCH] Remove some redundant logic  [ if (x) xfree(x); x=NULL; ] and
 restructure some code to comply with linux kernel programming standard.

---
 src/slurmd/req.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/slurmd/req.c b/src/slurmd/req.c
index 088fca5226c..de39692a14f 100644
--- a/src/slurmd/req.c
+++ b/src/slurmd/req.c
@@ -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);
 }
 
-- 
GitLab