diff options
author | Gaurav Kumar Garg <garg.gaurav52@gmail.com> | 2015-12-09 20:12:17 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2016-02-23 20:19:05 -0800 |
commit | e38bf1bdeda3c7a89be3193ad62a72b9139358dd (patch) | |
tree | 76bbbb4d708c3947f05434cfd7a91651cede960b /xlators/mgmt/glusterd/src/glusterd-syncop.c | |
parent | 8cf29a4207c162be8e2993ae36f49090851cbbfc (diff) |
glusterd: fixing few memory leak in glusterd
Current glusterd code base having memory leak. This is because of
memory allocate by dict_allocate_and_serialize function in
"gd_syncop_mgmt_v3_lock" and "gd_syncop_mgmt_v3_unlock"
function is not freeing up meory upon exit.
Fix is to free the memory after exit of the above function.
Thanx Carlos and Roman for finding out the issue and fix.
Change-Id: Id67aa794c84969830ca7ea8c2374f80c64d7a639
BUG: 1287517
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Signed-off-by: Carlos Chinea <carlos.chinea@nokia.com>
Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
Reviewed-on: http://review.gluster.org/12927
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index ac4870d516c..bb385d4775d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -215,6 +215,8 @@ out: iobref_unref (iobref); iobuf_unref (iobuf); + if (ret && frame) + STACK_DESTROY (frame->root); return ret; } @@ -411,6 +413,7 @@ gd_syncop_mgmt_v3_lock (glusterd_op_t op, dict_t *op_ctx, (xdrproc_t) xdr_gd1_mgmt_v3_lock_req); out: + GF_FREE (req.dict.dict_val); gf_msg_debug ("glusterd", 0, "Returning %d", ret); return ret; } @@ -510,6 +513,7 @@ gd_syncop_mgmt_v3_unlock (dict_t *op_ctx, glusterd_peerinfo_t *peerinfo, (xdrproc_t) xdr_gd1_mgmt_v3_unlock_req); out: + GF_FREE (req.dict.dict_val); gf_msg_debug ("glusterd", 0, "Returning %d", ret); return ret; } |