summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornik-redhat <nladha@redhat.com>2020-09-25 17:56:19 +0530
committernik-redhat <nladha@redhat.com>2020-09-25 17:59:22 +0530
commit99df784c1c6a086904cf3b77585a1797b1cc7b8e (patch)
treee19bbef079f8d7a45c62966972f755cc66d5f7d0
parent9310e319daad357e02fbc59a22fe4ba34d7bc4b3 (diff)
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 <nladha@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c3
1 files changed, 1 insertions, 2 deletions
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