From 174f963c846331c6dafda169451790b6039ef3fb Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 13 Sep 2010 08:32:37 +0000 Subject: rpc: in rpc_clnt_destroy(), cleanup the transport too * if we don't cleanup the transport, it will trigger false events on the free'd transport which causes crash Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1423 (Crash in gf_timer_call_cancel) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1423 --- rpc/rpc-lib/src/rpc-clnt.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'rpc') 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); -- cgit