[grilo] metadata-source: Don't try to free an uninitialised pointer



commit ff67f8492d77656de4b1ffeb2c8d97e2279630e2
Author: Chris Lord <chris linux intel com>
Date:   Fri Sep 24 09:19:59 2010 +0100

    metadata-source: Don't try to free an uninitialised pointer
    
    In grl_metadata_source_setup_full_resolution_mode, if the key-list is NULL
    then it skips to the end of the function - which frees the list and
    returns. This check happens before the list is assigned (or even, in fact,
    declare), so just return and avoid running g_list_free on uninitialised
    memory.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=630493

 src/grl-metadata-source.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/grl-metadata-source.c b/src/grl-metadata-source.c
index 165e139..702a049 100644
--- a/src/grl-metadata-source.c
+++ b/src/grl-metadata-source.c
@@ -917,7 +917,7 @@ grl_metadata_source_setup_full_resolution_mode (GrlMetadataSource *source,
 
   if (key_list == NULL) {
     GRL_DEBUG ("Source supports all requested keys");
-    goto done;
+    return;
   }
 
   /*
@@ -1060,7 +1060,7 @@ grl_metadata_source_setup_full_resolution_mode (GrlMetadataSource *source,
   if (key_mapping->source_maps == NULL) {
     GRL_DEBUG ("No key mapping for other sources, can't resolve more metadata");
   }
- done:
+
   g_list_free (sources);
   return;
 }



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