summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/rpc-lib/src/rpc-transport.c6
-rw-r--r--rpc/rpc-transport/socket/src/socket.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
index 29f02811f..39256d242 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;
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 1d6ebc803..ca3505d73 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -2484,9 +2484,6 @@ fini (rpc_transport_t *this)
GF_FREE (priv);
}
- if (this->name)
- GF_FREE (this->name);
-
this->private = NULL;
}