From 663df92f9b4b9f35ae10f84487494829987e2f58 Mon Sep 17 00:00:00 2001 From: nik-redhat Date: Fri, 25 Sep 2020 17:56:19 +0530 Subject: [PATCH 594/610] glusterd: resource leaks Issue: iobref was not freed before exiting the function. Fix: Modified the code to free iobref before exiting. CID: 1430107 >Updates: #1060 >Change-Id: I89351b3aa645792eb8dda6292d1e559057b02d8b >Signed-off-by: nik-redhat Upstream link: https://review.gluster.org/c/glusterfs/+/25042 BUG: 1997447 Change-Id: Iea56afca015a7c0f15ab32f490ea27f5ea323a07 Signed-off-by: nik-redhat Reviewed-on: https://code.engineering.redhat.com/gerrit/c/rhs-glusterfs/+/280066 Reviewed-by: Sunil Kumar Heggodu Gopala Acharya --- xlators/mgmt/glusterd/src/glusterd-utils.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 6d40be5..c037933 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -6042,7 +6042,6 @@ send_attach_req(xlator_t *this, struct rpc_clnt *rpc, char *path, GF_ATOMIC_INC(conf->blockers); ret = rpc_clnt_submit(rpc, &gd_brick_prog, op, cbkfn, &iov, 1, NULL, 0, iobref, frame, NULL, 0, NULL, 0, NULL); - return ret; free_iobref: iobref_unref(iobref); @@ -6051,7 +6050,7 @@ maybe_free_iobuf: iobuf_unref(iobuf); } err: - return -1; + return ret; } extern size_t -- 1.8.3.1