From f3d8a28662e831d43933ee33375ab96bc0961b24 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 8 Jul 2005 16:16:29 +0000 Subject: [PATCH] gst/registries/gstlibxmlregistry.c: plug more leaks. A simple gst_init() now is leakfree, yay. Original commit message from CVS: * gst/registries/gstlibxmlregistry.c: (load_feature): plug more leaks. A simple gst_init() now is leakfree, yay. --- ChangeLog | 5 +++++ gst/registries/gstlibxmlregistry.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 940c17e605..abb5fa0d25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-08 Thomas Vander Stichele + + * gst/registries/gstlibxmlregistry.c: (load_feature): + plug more leaks. A simple gst_init() now is leakfree, yay. + 2005-07-08 Thomas Vander Stichele * gst/registries/gstlibxmlregistry.c: (read_string), (load_paths), diff --git a/gst/registries/gstlibxmlregistry.c b/gst/registries/gstlibxmlregistry.c index 9a4d5f2a11..9cdb299270 100644 --- a/gst/registries/gstlibxmlregistry.c +++ b/gst/registries/gstlibxmlregistry.c @@ -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;