summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 3a48a41d76c..b5596b92542 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -3814,6 +3814,11 @@ glusterd_add_brick_mount_details (glusterd_brickinfo_t *brickinfo,
goto out;
mtab = setmntent (_PATH_MOUNTED, "r");
+ if (!mtab) {
+ ret = -1;
+ goto out;
+ }
+
entry = getmntent (mtab);
while (1) {
@@ -3854,6 +3859,9 @@ glusterd_add_brick_mount_details (glusterd_brickinfo_t *brickinfo,
out:
GF_FREE (mnt_pt);
+ if (mtab)
+ endmntent (mtab);
+
return ret;
}
#endif