summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2016-08-03 09:06:49 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2016-08-05 08:29:03 +0200
commit8bba28466b6c240e25676adc818e08bc6e4ef562 (patch)
tree79cd4de35c2b5b1e30f3132a8cd6b44bf9c16d85
parent57ba17589bb8aa2a20becc9aeec7675669cdd6d5 (diff)
wocky: Set ConnectAsyncData instance as GTask data
Currently, the ConnectAsyncData instance is leaked if for example we trigger one codepath calling g_task_return_error(). If we associate it with the GTask with g_task_set_task_data(), this kind of leak will be avoided.
-rw-r--r--src/wocky-http-proxy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wocky-http-proxy.c b/src/wocky-http-proxy.c
index d09cf41..cf51ba3 100644
--- a/src/wocky-http-proxy.c
+++ b/src/wocky-http-proxy.c
@@ -363,6 +363,8 @@ wocky_http_proxy_connect_async (GProxy *proxy,
data->length = strlen (data->buffer);
data->offset = 0;
+ g_task_set_task_data (task, data, (GDestroyNotify)free_connect_data);
+
if (WOCKY_IS_HTTPS_PROXY (proxy))
{
GError *error = NULL;
@@ -457,7 +459,6 @@ reply_read_cb (GObject *source,
g_task_return_pointer (data->task, data->io_stream, (GDestroyNotify) g_object_unref);
data->io_stream = NULL;
g_object_unref (data->task);
- free_connect_data (data);
}
static GIOStream *