From e38bf1bdeda3c7a89be3193ad62a72b9139358dd Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Garg Date: Wed, 9 Dec 2015 20:12:17 +0530 Subject: 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 Signed-off-by: Carlos Chinea Signed-off-by: Roman Tereshonkov Reviewed-on: http://review.gluster.org/12927 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- glusterfsd/src/glusterfsd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index c980e7bc640..4edb5894c60 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -2196,14 +2196,12 @@ glusterfs_process_volfp (glusterfs_ctx_t *ctx, FILE *fp) ret = glusterfs_graph_prepare (graph, ctx); if (ret) { - glusterfs_graph_destroy (graph); goto out; } ret = glusterfs_graph_activate (graph, ctx); if (ret) { - glusterfs_graph_destroy (graph); goto out; } @@ -2215,6 +2213,7 @@ out: fclose (fp); if (ret && !ctx->active) { + glusterfs_graph_destroy (graph); /* there is some error in setting up the first graph itself */ cleanup_and_exit (0); } -- cgit