17b94a
From 7e1bf1e338a6effe209f57b1b92a70d5d25a73bf Mon Sep 17 00:00:00 2001
17b94a
From: Jiffin Tony Thottan <jthottan@redhat.com>
17b94a
Date: Mon, 26 Aug 2019 11:32:18 +0530
17b94a
Subject: [PATCH 428/449] glusterd/ganesha: fixing resource leak in
17b94a
 tear_down_cluster()
17b94a
17b94a
backport of https://review.gluster.org/#/c/glusterfs/+/23295/
17b94a
>CID: 1370947
17b94a
>Updates: bz#789278
17b94a
>Change-Id: Ib694056430ff0536ed705a0e77e5ace22486891e
17b94a
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
17b94a
17b94a
BUG: 1787310
17b94a
Change-Id: Ib694056430ff0536ed705a0e77e5ace22486891e
17b94a
Signed-off-by: Barak Sason Rofman <bsasonro@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/202561
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
17b94a
---
17b94a
 xlators/mgmt/glusterd/src/glusterd-ganesha.c | 8 ++++++++
17b94a
 1 file changed, 8 insertions(+)
17b94a
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
17b94a
index 0a16925..06f028f 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
17b94a
@@ -659,10 +659,18 @@ tear_down_cluster(gf_boolean_t run_teardown)
17b94a
                          "Failed to close dir %s. Reason :"
17b94a
                          " %s",
17b94a
                          CONFDIR, strerror(errno));
17b94a
+            goto exit;
17b94a
         }
17b94a
     }
17b94a
 
17b94a
 out:
17b94a
+    if (dir && sys_closedir(dir)) {
17b94a
+        gf_msg_debug(THIS->name, 0,
17b94a
+                     "Failed to close dir %s. Reason :"
17b94a
+                     " %s",
17b94a
+                     CONFDIR, strerror(errno));
17b94a
+    }
17b94a
+exit:
17b94a
     return ret;
17b94a
 }
17b94a
 
17b94a
-- 
17b94a
1.8.3.1
17b94a