From 6ff2fd2e05c35562cf9505b95d191ee7fe001823 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Thu, 31 Jul 2014 05:37:37 +0200 Subject: Do not call rpc_transport_unref() on NULL trans rpc_clnt_disable() sets rpc->conn->trans to NULL, hence we should not call rpc_transport_unref() afterwards. I moved it before the rpc_clnt_disable() call, but I am not sure it should be called at all, perhaps it should just go away. BUG: 764655 Change-Id: I488d0207494e3a3fad52e64e67b2e740b236b864 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/8393 Reviewed-by: Harshavardhana Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- rpc/rpc-lib/src/rpc-clnt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rpc/rpc-lib') diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 2ae2dfb71bf..4c8333b7d5d 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1623,14 +1623,16 @@ rpc_clnt_ref (struct rpc_clnt *rpc) static void rpc_clnt_trigger_destroy (struct rpc_clnt *rpc) { - rpc_clnt_connection_t *conn = NULL; + rpc_clnt_connection_t *conn = NULL; + rpc_transport_t *trans = NULL; if (!rpc) return; conn = &rpc->conn; + trans = conn->trans; rpc_clnt_disable (rpc); - rpc_transport_unref (conn->trans); + rpc_transport_unref (trans); } static void -- cgit