summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2018-07-31 19:03:05 +0530
committergluster-ant <bugzilla-bot@gluster.org>2018-07-31 19:03:05 +0530
commit88c317b3e76e585a9904bb251aa41df21151b2be (patch)
tree5a7321b9d92fba620dbd19d3da6dad78def4b2a7
parentdf4e2da481c17c55c0356552aafba6de80f2979a (diff)
downloadglusterfs-88c317b3e76e585a9904bb251aa41df21151b2be.tar.gz
glusterfs-88c317b3e76e585a9904bb251aa41df21151b2be.tar.xz
glusterfs-88c317b3e76e585a9904bb251aa41df21151b2be.zip
geo-rep : fix few coverity issues in procdiggy.c
This patch fixes BAD_FREE at line number 75,105 and UNUSED_VALUE at line number 108. CID : 1274068 scan detail at [1]. [1] https://scan6.coverity.com/reports.htm#v42401/p10714/fileInstanceId=84384726&defectInstanceId=25600457&mergedDefectId=727233 Change-Id: I8dff42546204bf78c178c9dcaba534888c5354e9 updates: bz#789278 Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
-rw-r--r--geo-replication/src/procdiggy.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/geo-replication/src/procdiggy.c b/geo-replication/src/procdiggy.c
index 35125d20ba..4fb6a2405e 100644
--- a/geo-replication/src/procdiggy.c
+++ b/geo-replication/src/procdiggy.c
@@ -72,8 +72,8 @@ pidinfo (pid_t pid, char **name)
out:
fclose (f);
- if (pid == -1 && name && *name)
- GF_FREE (name);
+ if (pid == -1 && name && *name)
+ GF_FREE (*name);
if (pid == -2)
fprintf (stderr, "out of memory\n");
return pid;
@@ -104,8 +104,10 @@ prociter (int (*proch) (pid_t pid, pid_t ppid, char *tmpname, void *data),
if (gf_string2int (de->d_name, &pid) != -1 && pid >= 0) {
ppid = pidinfo (pid, &name);
switch (ppid) {
- case -1: continue;
- case -2: ret = -1; break;
+ case -1:
+ continue;
+ case -2:
+ break;
}
ret = proch (pid, ppid, name, data);
GF_FREE (name);