summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpc-clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/rpc-lib/src/rpc-clnt.c')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index 52316a03a58..4b01a3c0494 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -798,6 +798,8 @@ rpc_clnt_notify (rpc_transport_t *trans, void *mydata,
goto out;
}
clnt = conn->rpc_clnt;
+ if (!clnt)
+ goto out;
switch (event) {
case RPC_TRANSPORT_DISCONNECT:
@@ -1386,6 +1388,10 @@ out:
void
rpc_clnt_destroy (struct rpc_clnt *rpc)
{
+ if (!rpc)
+ return;
+
+ rpc_transport_destroy (rpc->conn.trans);
rpc_clnt_connection_cleanup (&rpc->conn);
rpc_clnt_reconnect_cleanup (&rpc->conn);
pthread_mutex_destroy (&rpc->lock);