diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2016-12-03 09:09:15 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-12-04 17:28:40 -0800 |
commit | c89cb610f51e7a5df5c4b7e9378a7ac8ac513e46 (patch) | |
tree | 1ddaeb27a9ba9d24ca9efa290bc76e393e798a0e /xlators/protocol/client/src/client-common.c | |
parent | 55ddf8c6b665d0b2ed024b984e871a68b25cffbf (diff) |
afr, client: More mem-leak fixes in COMPOUND fop cbk
Bugs found and fixed:
1. Use correct subvolume index in pre-op-writev compound cbk
2. Prevent use-after-free of local->compound_args members in
compound fops cbk in protocol/client
3. Fix xdata and xattr leaks in client_process_response
4. Fix possible leak of xdata in client_pre_writev() in
test mode.
5. Free req->compound_req_array.compound_req_array_val as well
after freeing its members
6. Free tmp_rsp->flock.lk_owner.lk_owner_val in LK fop.
Change-Id: I15b646d7d4e0e5cd4ea3d2d6452c815cf2eaf68f
BUG: 1401218
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/16020
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/protocol/client/src/client-common.c')
-rw-r--r-- | xlators/protocol/client/src/client-common.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/xlators/protocol/client/src/client-common.c b/xlators/protocol/client/src/client-common.c index 19cf3c8991d..873b0f0f4ae 100644 --- a/xlators/protocol/client/src/client-common.c +++ b/xlators/protocol/client/src/client-common.c @@ -367,7 +367,7 @@ out: int client_pre_writev (xlator_t *this, gfs3_write_req *req, fd_t *fd, size_t size, off_t offset, int32_t flags, - dict_t *xdata) + dict_t **xdata) { int64_t remote_fd = -1; int op_errno = ESTALE; @@ -383,14 +383,14 @@ client_pre_writev (xlator_t *this, gfs3_write_req *req, memcpy (req->gfid, fd->inode->gfid, 16); #ifdef GF_TESTING_IO_XDATA - if (!xdata) - xdata = dict_new (); + if (!*xdata) + *xdata = dict_new (); - ret = dict_set_str (xdata, "testing-the-xdata-key", + ret = dict_set_str (*xdata, "testing-the-xdata-key", "testing-the-xdata-value"); #endif - GF_PROTOCOL_DICT_SERIALIZE (this, xdata, (&req->xdata.xdata_val), + GF_PROTOCOL_DICT_SERIALIZE (this, *xdata, (&req->xdata.xdata_val), req->xdata.xdata_len, op_errno, out); return 0; |