summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-30 01:49:52 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-30 01:52:18 -0700
commitf63e4b6e9aada6f96c71513bcf7f501f613a30fe (patch)
treedd392728efef8c66c3cefa9af6b370b783d6252d
parentb7aed950dbeba2fdc952f734ca2f713acee2345d (diff)
rpc: in rpc_clnt_destroy(), destroy the memory pool also
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1727 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1727
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index 3019daebbcf..61bc5263dc7 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -1000,6 +1000,8 @@ rpc_clnt_init (struct rpc_clnt_config *config, dict_t *options,
ret = rpc_clnt_connection_init (rpc, ctx, options, name);
if (ret == -1) {
pthread_mutex_destroy (&rpc->lock);
+ mem_pool_destroy (rpc->reqpool);
+ mem_pool_destroy (rpc->saved_frames_pool);
GF_FREE (rpc);
rpc = NULL;
if (options)
@@ -1457,6 +1459,12 @@ rpc_clnt_destroy (struct rpc_clnt *rpc)
saved_frames_destroy (rpc->conn.saved_frames);
pthread_mutex_destroy (&rpc->lock);
pthread_mutex_destroy (&rpc->conn.lock);
+
+ /* mem-pool should be destroyed, otherwise,
+ it will cause huge memory leaks */
+ mem_pool_destroy (rpc->reqpool);
+ mem_pool_destroy (rpc->saved_frames_pool);
+
GF_FREE (rpc);
return;
}