aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-01-31 20:59:23 +0800
committerMilan Crha <mcrha@redhat.com>2014-01-31 21:01:57 +0800
commit2acd31fe1c847b3794a116f5e365868e999db3c8 (patch)
treed4882a3150fea19257c94a621122778d038241e4
parent7652b019dc74f3bdb04befa136a2a0e8611e9c8d (diff)
downloadgsoc2013-evolution-2acd31fe1c847b3794a116f5e365868e999db3c8.tar
gsoc2013-evolution-2acd31fe1c847b3794a116f5e365868e999db3c8.tar.gz
gsoc2013-evolution-2acd31fe1c847b3794a116f5e365868e999db3c8.tar.bz2
gsoc2013-evolution-2acd31fe1c847b3794a116f5e365868e999db3c8.tar.lz
gsoc2013-evolution-2acd31fe1c847b3794a116f5e365868e999db3c8.tar.xz
gsoc2013-evolution-2acd31fe1c847b3794a116f5e365868e999db3c8.tar.zst
gsoc2013-evolution-2acd31fe1c847b3794a116f5e365868e999db3c8.zip
EHttpRequest: Avoid possible data stream memory leak
The request's finish function is not called in case when the request is cancelled, which meant that the whole data stream was leaked.
-rw-r--r--mail/e-http-request.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mail/e-http-request.c b/mail/e-http-request.c
index c85a26810e..534e30bff6 100644
--- a/mail/e-http-request.c
+++ b/mail/e-http-request.c
@@ -283,7 +283,7 @@ handle_http_request (GSimpleAsyncResult *res,
/* Set result and quit the thread */
g_simple_async_result_set_op_res_gpointer (
- res, stream, NULL);
+ res, stream, g_object_unref);
goto cleanup;
} else {
@@ -446,7 +446,7 @@ handle_http_request (GSimpleAsyncResult *res,
uri, priv->content_type,
priv->content_length, uri_md5));
- g_simple_async_result_set_op_res_gpointer (res, stream, NULL);
+ g_simple_async_result_set_op_res_gpointer (res, stream, g_object_unref);
goto cleanup;
}
@@ -541,6 +541,8 @@ http_request_send_finish (SoupRequest *request,
if (!stream) /* We must always return something */
stream = g_memory_input_stream_new ();
+ else
+ g_object_ref (stream);
return stream;
}