Commit d08eba96 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Fix: Fixed report XML related memory leaks

parent c02f34e9
...@@ -2150,6 +2150,7 @@ static void _parse_paths(xmlDocPtr doc, ...@@ -2150,6 +2150,7 @@ static void _parse_paths(xmlDocPtr doc,
ICECAST_LOG_ERROR("Can not parse report xml database \"%H\"", temp); ICECAST_LOG_ERROR("Can not parse report xml database \"%H\"", temp);
} else { } else {
reportxml_database_add_report(configuration->reportxml_db, report); reportxml_database_add_report(configuration->reportxml_db, report);
refobject_unref(report);
ICECAST_LOG_INFO("File \"%H\" added to report xml database", temp); ICECAST_LOG_INFO("File \"%H\" added to report xml database", temp);
} }
} }
......
...@@ -458,9 +458,11 @@ reportxml_node_t * reportxml_node_parse_xmlnode(xmlNodePtr xmlnode) ...@@ -458,9 +458,11 @@ reportxml_node_t * reportxml_node_parse_xmlnode(xmlNodePtr xmlnode)
} }
if (reportxml_node_add_child(node, child) != 0) { if (reportxml_node_add_child(node, child) != 0) {
refobject_unref(child);
refobject_unref(node); refobject_unref(node);
return NULL; return NULL;
} }
refobject_unref(child);
} }
} while ((cur = cur->next)); } while ((cur = cur->next));
} }
...@@ -522,6 +524,8 @@ static reportxml_node_t * __reportxml_node_copy_with_db(reportxml_node_t *n ...@@ -522,6 +524,8 @@ static reportxml_node_t * __reportxml_node_copy_with_db(reportxml_node_t *n
refobject_unref(ret); refobject_unref(ret);
return NULL; return NULL;
} }
refobject_unref(copy);
} }
} }
...@@ -959,6 +963,8 @@ int reportxml_database_add_report(reportxml_database_t *db, ...@@ -959,6 +963,8 @@ int reportxml_database_add_report(reportxml_database_t *db,
thread_mutex_unlock(&(db->lock)); thread_mutex_unlock(&(db->lock));
refobject_unref(root);
return 0; return 0;
} }
......
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