mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Fix: Ensure references are counted correctly in case reportxml_node_copy() fails
This commit is contained in:
parent
c4dca907ab
commit
ae489acc93
@ -440,15 +440,18 @@ reportxml_node_t * reportxml_node_copy(reportxml_node_t *node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < (size_t)count; i++) {
|
for (i = 0; i < (size_t)count; i++) {
|
||||||
reportxml_node_t *child = reportxml_node_copy(reportxml_node_get_child(node, i));
|
reportxml_node_t *child = reportxml_node_get_child(node, i);
|
||||||
|
reportxml_node_t *copy = reportxml_node_copy(child);
|
||||||
|
|
||||||
if (!child) {
|
refobject_unref(child);
|
||||||
|
|
||||||
|
if (!copy) {
|
||||||
refobject_unref(ret);
|
refobject_unref(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reportxml_node_add_child(ret, child) != 0) {
|
if (reportxml_node_add_child(ret, copy) != 0) {
|
||||||
refobject_unref(child);
|
refobject_unref(copy);
|
||||||
refobject_unref(ret);
|
refobject_unref(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user