From e470c060351c5c1b477b82bbe18c5adc00241384 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Fri, 16 Dec 2016 09:31:41 +0530 Subject: protocol/client: Fix potential mem-leaks Backport of: http://review.gluster.org/16156 Commit 93eaeb9c93be3232f24e840044d560f9f0e66f71 introduces leaks in INODELK callback where a dict is unserialized twice, leading to dict leaks. Change-Id: I2ad6f4243d78ba30841731d331f5a4a0006827da BUG: 1405886 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/16187 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra G --- xlators/protocol/client/src/client-handshake.c | 1 + xlators/protocol/client/src/client-rpc-fops.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'xlators/protocol') diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 3284facb893..dc6e244e717 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -86,6 +86,7 @@ out: /* Don't use 'GF_FREE', this is allocated by libc */ free (rsp.spec); + free (rsp.xdata.xdata_val); return 0; } diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c index b26c4946d7f..2e965653e67 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -1534,10 +1534,6 @@ client3_3_inodelk_cbk (struct rpc_req *req, struct iovec *iov, int count, goto out; } - GF_PROTOCOL_DICT_UNSERIALIZE (this, xdata, (rsp.xdata.xdata_val), - (rsp.xdata.xdata_len), ret, - rsp.op_errno, out); - ret = client_post_inodelk (this, &rsp, &xdata); if (ret < 0) goto out; -- cgit