summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrizio Gennari <fabrizio.ge@tiscali.it>2008-03-01 11:21:30 +0000
committerTim-Philipp Müller <tim@centricular.net>2008-03-01 11:21:30 +0000
commit96aa08f00835f5179b8caba3cb35f5143525c05d (patch)
tree3e198531e251a5b2c1a67c78bf8ee1a4b796daa9
parent97bf2d2d78ef64619418527cf03e6960bab69467 (diff)
gst/gstregistryxml.c: Strings allocated by libxml2 should be freed with xmlFree(), not with g_free(). Fixes issues on...
Original commit message from CVS: Patch by: Fabrizio Gennari <fabrizio.ge at tiscali it> * gst/gstregistryxml.c: (read_string), (load_feature): Strings allocated by libxml2 should be freed with xmlFree(), not with g_free(). Fixes issues on windows in certain contexts (#519698).
-rw-r--r--ChangeLog8
-rw-r--r--gst/gstregistryxml.c19
2 files changed, 20 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 2938e6ae56..8cdd684d48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-03-01 Tim-Philipp Müller <tim at centricular dot net>
+
+ Patch by: Fabrizio Gennari <fabrizio.ge at tiscali it>
+
+ * gst/gstregistryxml.c: (read_string), (load_feature):
+ Strings allocated by libxml2 should be freed with xmlFree(), not
+ with g_free(). Fixes issues on windows in certain contexts (#519698).
+
2008-02-29 Tim-Philipp Müller <tim at centricular dot net>
* gst/gstinterface.c: (gst_element_implements_interface):
diff --git a/gst/gstregistryxml.c b/gst/gstregistryxml.c
index 27d2a13113..ab3f3b1ca5 100644
--- a/gst/gstregistryxml.c
+++ b/gst/gstregistryxml.c
@@ -123,9 +123,15 @@ read_string (xmlTextReaderPtr reader, gchar ** write_to, gboolean allow_blank)
return found;
}
if (xmlTextReaderNodeType (reader) == XML_READER_TYPE_TEXT) {
+ xmlChar *value;
+
if (found)
return FALSE;
- *write_to = (gchar *) xmlTextReaderValue (reader);
+
+ value = xmlTextReaderValue (reader);
+ *write_to = g_strdup ((gchar *) value);
+ xmlFree (value);
+
found = TRUE;
}
}
@@ -255,21 +261,20 @@ load_feature (xmlTextReaderPtr reader)
{
int ret;
int depth;
- gchar *feature_name;
+ xmlChar *feature_name;
GstPluginFeature *feature;
GType type;
depth = xmlTextReaderDepth (reader);
- feature_name =
- (gchar *) xmlTextReaderGetAttribute (reader, BAD_CAST "typename");
+ feature_name = xmlTextReaderGetAttribute (reader, BAD_CAST "typename");
- GST_LOG ("loading feature");
+ GST_LOG ("loading feature '%s'", GST_STR_NULL ((const char *) feature_name));
if (!feature_name)
return NULL;
- type = g_type_from_name (feature_name);
- g_free (feature_name);
+ type = g_type_from_name ((const char *) feature_name);
+ xmlFree (feature_name);
feature_name = NULL;
if (!type) {