gst/registries/gstlibxmlregistry.c: plug more leaks. A simple gst_init() now is...
authorThomas Vander Stichele <thomas@apestaart.org>
Fri, 8 Jul 2005 16:16:29 +0000 (16:16 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Fri, 8 Jul 2005 16:16:29 +0000 (16:16 +0000)
Original commit message from CVS:

* gst/registries/gstlibxmlregistry.c: (load_feature):
plug more leaks.  A simple gst_init() now is leakfree, yay.

ChangeLog
gst/registries/gstlibxmlregistry.c

index 940c17e..abb5fa0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-07-08  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+       * gst/registries/gstlibxmlregistry.c: (load_feature):
+         plug more leaks.  A simple gst_init() now is leakfree, yay.
+
+2005-07-08  Thomas Vander Stichele  <thomas at apestaart dot org>
+
        * gst/registries/gstlibxmlregistry.c: (read_string), (load_paths),
        (gst_xml_registry_load):
          plug another memleak
index 9a4d5f2..9cdb299 100644 (file)
@@ -552,6 +552,7 @@ gst_xml_registry_close_func (GstXMLRegistry * registry)
   return TRUE;
 }
 
+/* takes ownership of given value */
 static void
 add_to_char_array (gchar *** array, gchar * value)
 {
@@ -756,17 +757,21 @@ load_feature (xmlTextReaderPtr reader)
             } else if (g_ascii_strncasecmp (s, "source", 5) == 0) {
               factory->uri_type = GST_URI_SRC;
             }
+            g_free (s);
           }
         } else if (g_str_equal (tag, "uri_protocol")) {
           gchar *s = NULL;
 
-          if (read_string (reader, &s))
+          if (read_string (reader, &s)) {
             add_to_char_array (&factory->uri_protocols, s);
+          }
         } else if (g_str_equal (tag, "interface")) {
           gchar *s = NULL;
 
-          if (read_string (reader, &s))
+          if (read_string (reader, &s)) {
             __gst_element_factory_add_interface (factory, s);
+            g_free (s);
+          }
         } else if (g_str_equal (tag, "padtemplate")) {
           GstStaticPadTemplate *template = load_pad_template (reader);
 
@@ -782,8 +787,9 @@ load_feature (xmlTextReaderPtr reader)
         if (g_str_equal (tag, "extension")) {
           gchar *s = NULL;
 
-          if (read_string (reader, &s))
+          if (read_string (reader, &s)) {
             add_to_char_array (&factory->extensions, s);
+          }
         } else if (g_str_equal (tag, "caps")) {
           gchar *s = NULL;