From 99df784c1c6a086904cf3b77585a1797b1cc7b8e Mon Sep 17 00:00:00 2001 From: nik-redhat Date: Fri, 25 Sep 2020 17:56:19 +0530 Subject: 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 --- xlators/mgmt/glusterd/src/glusterd-utils.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index a2049332526..d0e72e0874f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -6106,7 +6106,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); @@ -6115,7 +6114,7 @@ maybe_free_iobuf: iobuf_unref(iobuf); } err: - return -1; + return ret; } extern size_t -- cgit