summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-07-16 17:24:15 +0200
committerJuan A. Suarez Romero <jasuarez@igalia.com>2014-07-21 20:39:32 +0000
commita1f85561a662a70924b41d4b82eb499ccd7f9b5b (patch)
treefef4a7f261ea5ff2e137344deb39813abd09c169 /libs
parent665081a94589f18e60794936565b1fa320d00aaf (diff)
downloadgrilo-a1f85561a662a70924b41d4b82eb499ccd7f9b5b.tar.gz
net: Fix double-free using the Jamendo plugin
The item in the queue is already freed when the source is removed, through a destroy notify, so no need to do it twice. Ensure we cancel the cancellable though, but do not unref it as we do not own it. https://bugzilla.gnome.org/show_bug.cgi?id=733232
Diffstat (limited to 'libs')
-rw-r--r--libs/net/grl-net-wc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/net/grl-net-wc.c b/libs/net/grl-net-wc.c
index a126d63..ba3f713 100644
--- a/libs/net/grl-net-wc.c
+++ b/libs/net/grl-net-wc.c
@@ -1128,10 +1128,10 @@ grl_net_wc_flush_delayed_requests (GrlNetWc *self)
g_return_if_fail (GRL_IS_NET_WC (self));
while ((c = g_queue_pop_head (priv->pending))) {
+ if (c->cancellable)
+ g_cancellable_cancel (c->cancellable);
+ /* This will call the destroy notify, request_clos_destroy() */
g_source_remove (c->source_id);
- g_object_unref (c->cancellable);
- g_free (c->url);
- g_free (c);
}
g_get_current_time (&priv->last_request);