From 49f1b76f471f0845a2c7edf69f5629226f73ad27 Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Sat, 3 Nov 2018 23:09:40 +0530 Subject: glusterd : fix high sev coverity issue This patch fixes CID : 1174824 : RESOURCE_LEAK updates: bz#789278 Change-Id: I2a4f8b508995de112fa16e1094e44ecd4b625312 Signed-off-by: Sunny Kumar --- xlators/mgmt/glusterd/src/glusterd-store.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 9981a1ce1a3..f0ee571c993 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -4553,8 +4553,10 @@ glusterd_store_retrieve_peers(xlator_t *this) goto next; ret = gf_store_iter_get_next(iter, &key, &value, &op_errno); - if (ret) + if (ret) { + (void)gf_store_iter_destroy(iter); goto next; + } /* Create an empty peerinfo object before reading in the * details @@ -4649,6 +4651,7 @@ glusterd_store_retrieve_peers(xlator_t *this) peerinfo = NULL; out: + if (dir) sys_closedir(dir); gf_msg_debug(this->name, 0, "Returning with %d", ret); -- cgit