Commit 7134af3d authored by Jens Georg's avatar Jens Georg
Browse files

Do not hand out libxml2-allocated strings

We can't use xml_util_get_child_element_content_glib as this early-exits and
we need to collect all values that can occur.

On top of that, don't add empty list entries.

https://bugzilla.gnome.org/show_bug.cgi?id=708751
parent f16a62e7
...@@ -952,9 +952,18 @@ gupnp_device_info_list_dlna_device_class_identifier (GUPnPDeviceInfo *info) ...@@ -952,9 +952,18 @@ gupnp_device_info_list_dlna_device_class_identifier (GUPnPDeviceInfo *info)
for (element = element->children; element; element = element->next) { for (element = element->children; element; element = element->next) {
/* No early exit since the node explicitly may appear multiple /* No early exit since the node explicitly may appear multiple
* times: 7.2.10.3 */ * times: 7.2.10.3 */
if (!strcmp ("X_DLNADOC", (char *) element->name)) if (!strcmp ("X_DLNADOC", (char *) element->name)) {
xmlChar *content = NULL;
content = xmlNodeGetContent (element);
if (content == NULL)
continue;
list = g_list_prepend (list, list = g_list_prepend (list,
xmlNodeGetContent(element)); g_strdup ((char *) content));
xmlFree (content);
}
} }
/* Return in order of appearance in document */ /* Return in order of appearance in document */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment