[grilo] net: Fix double-free using the Jamendo plugin



commit a1f85561a662a70924b41d4b82eb499ccd7f9b5b
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jul 16 17:24:15 2014 +0200

    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

 libs/net/grl-net-wc.c |    6 +++---
 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]