From d18b830fb78a141f4c38a40be7c470485b9250ea Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Sat, 6 Sep 2014 02:57:41 +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. This is a backport of I488d0207494e3a3fad52e64e67b2e740b236b864 BUG: 1138897 Change-Id: I001ab73b37f74ba98463bd9c32c01c670e9c7ad8 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/8629 Tested-by: Gluster Build System Reviewed-by: Humble Devassy Chirammal Reviewed-by: Raghavendra G Reviewed-by: Vijay Bellur --- 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 b831c537723..bb0df12e8b8 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -1619,14 +1619,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