summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2020-07-20 11:53:10 +0530
committerSanju Rakonde <srakonde@redhat.com>2020-07-20 18:26:32 +0530
commitd05a2332bf5f0a92c57f99de06476d4a78c65baa (patch)
tree9bb66f826c5bac954e31e83443a47b09204a90ad /xlators/mgmt/glusterd/src
parent1eae3379aed2a7f3fdb9997abcf23130c83bc779 (diff)
glusterd: avoid crash
When dirp is null, we should not call sys_closedir() on it. fixes: #1379 Change-Id: I33633df983aeea11e9d685e41ed9ec58644b6258 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 6b97464..b1c3a49 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -6545,7 +6545,8 @@ search_brick_path_from_proc(pid_t brick_pid, char *brickpath)
}
}
out:
- sys_closedir(dirp);
+ if (dirp)
+ sys_closedir(dirp);
return brick_path;
}