diff options
author | Amar Tumballi <amar@gluster.com> | 2010-09-30 01:49:52 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-30 01:52:18 -0700 |
commit | f63e4b6e9aada6f96c71513bcf7f501f613a30fe (patch) | |
tree | dd392728efef8c66c3cefa9af6b370b783d6252d /rpc/rpc-lib/src | |
parent | b7aed950dbeba2fdc952f734ca2f713acee2345d (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
Diffstat (limited to 'rpc/rpc-lib/src')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 8 |
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 3019daebb..61bc5263d 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; } |