summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-15 04:53:34 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-15 03:38:34 -0700
commit7618628ff3c469af38d9c58840e5d0c8fde7156a (patch)
treed71857b4b442b1c8ef32a065af4682af48611d5f /rpc/rpc-lib
parent3d1a0c2e3787f1c1b6cb1eb45690f36e175e983b (diff)
rpc-transport.c: handle a double free
* 'this->name' was getting freed in '(transport)->fini()'. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1605 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1605
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index 29f02811fdd..39256d2422f 100644
--- a/rpc/rpc-lib/src/rpc-transport.c
+++ b/rpc/rpc-lib/src/rpc-transport.c
@@ -1063,8 +1063,12 @@ rpc_transport_destroy (rpc_transport_t *this)
if (this->fini)
this->fini (this);
+
pthread_mutex_destroy (&this->lock);
- GF_FREE (this->name);
+
+ if (this->name)
+ GF_FREE (this->name);
+
GF_FREE (this);
fail:
return ret;