From 4df8d18a6f6496ed9bff28bade0bc486c92e1e6a Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Tue, 13 Jan 2015 16:26:38 +0200 Subject: [PATCH] purple: do not use gc as handle for TCP connects libpurple automatically cancels all pending proxy connects which have gc as handle, thus leaving us with an invalid transport->proxy value that leads to a crash in our cleanup code. Detected when closing Pidgin while EWS autodiscover was trying to connect to a http://...:80 URL. --- src/purple/purple-transport.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/purple/purple-transport.c b/src/purple/purple-transport.c index a5c80466..036b1302 100644 --- a/src/purple/purple-transport.c +++ b/src/purple/purple-transport.c @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2010-2013 SIPE Project + * Copyright (C) 2010-2015 SIPE Project * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -272,7 +272,15 @@ sipe_backend_transport_connect(struct sipe_core_public *sipe_public, /* TCP case */ SIPE_DEBUG_INFO_NOFORMAT("using TCP"); - if ((transport->proxy = purple_proxy_connect(gc, account, + /* + * NOTE: during shutdown libpurple calls + * + * purple_proxy_connect_cancel_with_handle(gc); + * + * before our cleanup code. Therefore we can't use "gc" as + * handle. We are not using it for anything thus NULL is fine. + */ + if ((transport->proxy = purple_proxy_connect(NULL, account, setup->server_name, setup->server_port, transport_tcp_connected, -- 2.11.4.GIT