]> www.fi.muni.cz Git - evince.git/commitdiff
Fix memory leaks. Fixes bug #333945
authorCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 14 Mar 2006 18:36:12 +0000 (18:36 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Tue, 14 Mar 2006 18:36:12 +0000 (18:36 +0000)
2006-03-14  Carlos Garcia Campos  <carlosgc@gnome.org>
* shell/ev-metadata-manager.c (parseItem):
Fix memory leaks. Fixes bug #333945

ChangeLog
shell/ev-metadata-manager.c

index bd19ccb5d1b9e17fb65a8158ac51ac4356433c27..9bff823150422906111d219deee0df11a673153c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-14  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-metadata-manager.c (parseItem):
+
+       Fix memory leaks. Fixes bug #333945
+
 2006-03-13  Nickolay V. Shmyrev <nshmyrev@yandex.ru>
        
        * NEWS, configure.ac, TODO:
index 4103a3516eeb5db96a44789b530c769813a948af..f5ab0407b62fee42f21ea874c5f60e745f05a628 100644 (file)
@@ -127,6 +127,15 @@ ev_metadata_manager_shutdown (void)
        ev_metadata_manager = NULL;
 }
 
+static void
+value_free (gpointer data)
+{
+       GValue *value = (GValue *)data;
+
+       g_value_unset (value);
+       g_free (value);
+}
+
 static GValue *
 parse_value (xmlChar *value, xmlChar *type)
 {
@@ -184,7 +193,7 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur)
        item->values = g_hash_table_new_full (g_str_hash, 
                                              g_str_equal, 
                                              g_free, 
-                                             g_free);
+                                             value_free);
 
        cur = cur->xmlChildrenNode;
                
@@ -195,7 +204,7 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur)
                        xmlChar *key;
                        xmlChar *xml_value;
                        xmlChar *type;
-                       GValue *value;
+                       GValue  *value;
                        
                        key = xmlGetProp (cur, (const xmlChar *)"key");
                        xml_value = xmlGetProp (cur, (const xmlChar *)"value");
@@ -209,6 +218,8 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur)
 
                        if (key != NULL)
                                xmlFree (key);
+                       if (type != NULL)
+                               xmlFree (type);
                        if (xml_value != NULL)
                                xmlFree (xml_value);
                }
@@ -286,16 +297,6 @@ load_values ()
        return TRUE;
 }
 
-static void
-value_free (gpointer data)
-{
-       GValue *value = (GValue *)data;
-
-       g_value_unset (value);
-       g_free (value);
-}
-
-
 #define LAST_URI "last-used-value"
 
 static gboolean