diff --git a/src/cfgfile.c b/src/cfgfile.c index 87e46883..b717fdfd 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -2150,6 +2150,7 @@ static void _parse_paths(xmlDocPtr doc, ICECAST_LOG_ERROR("Can not parse report xml database \"%H\"", temp); } else { reportxml_database_add_report(configuration->reportxml_db, report); + refobject_unref(report); ICECAST_LOG_INFO("File \"%H\" added to report xml database", temp); } } diff --git a/src/reportxml.c b/src/reportxml.c index f597a15e..b4f3554e 100644 --- a/src/reportxml.c +++ b/src/reportxml.c @@ -458,9 +458,11 @@ reportxml_node_t * reportxml_node_parse_xmlnode(xmlNodePtr xmlnode) } if (reportxml_node_add_child(node, child) != 0) { + refobject_unref(child); refobject_unref(node); return NULL; } + refobject_unref(child); } } while ((cur = cur->next)); } @@ -522,6 +524,8 @@ static reportxml_node_t * __reportxml_node_copy_with_db(reportxml_node_t *n refobject_unref(ret); return NULL; } + + refobject_unref(copy); } } @@ -959,6 +963,8 @@ int reportxml_database_add_report(reportxml_database_t *db, thread_mutex_unlock(&(db->lock)); + refobject_unref(root); + return 0; }