[grilo-plugins] filesystem: Fix a potential memory leak in an error handling path



commit b3e134b23566356d4d92ad7d613a3708751356e2
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Oct 24 13:30:48 2013 +0100

    filesystem: Fix a potential memory leak in an error handling path
    
    It is possible to leave the loop in this function before visiting every
    element in idle_data->entries, thus leaking the data in the remaining
    elements. Tidy up the deallocation strategy to avoid the leak.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710796

 src/filesystem/grl-filesystem.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/filesystem/grl-filesystem.c b/src/filesystem/grl-filesystem.c
index 05a0fbe..5408c37 100644
--- a/src/filesystem/grl-filesystem.c
+++ b/src/filesystem/grl-filesystem.c
@@ -625,7 +625,6 @@ browse_emit_idle (gpointer user_data)
 
     uri = (gchar *) idle_data->current->data;
     file = g_file_new_for_uri (uri);
-    g_free (uri);
 
     content = create_content (NULL,
                               file,
@@ -652,7 +651,7 @@ browse_emit_idle (gpointer user_data)
   return TRUE;
 
 finish:
-    g_list_free (idle_data->entries);
+    g_list_free_full (idle_data->entries, g_free);
     g_hash_table_remove (fs_source->priv->cancellables,
                          GUINT_TO_POINTER (idle_data->id));
     g_object_unref (idle_data->cancellable);


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