summaryrefslogtreecommitdiff
path: root/src/core/document.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/document.c')
-rw-r--r--src/core/document.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/document.c b/src/core/document.c
index ef2a54e..723d4f8 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -127,6 +127,8 @@ dom_exception _dom_document_initialise(dom_document *doc,
err = _dom_node_initialise(&doc->base, doc, DOM_DOCUMENT_NODE,
name, NULL, NULL, NULL);
dom_string_unref(name);
+ if (err != DOM_NO_ERR)
+ return err;
list_init(&doc->pending_nodes);
@@ -963,10 +965,9 @@ dom_exception _dom_document_adopt_node(dom_document *doc,
*result = NULL;
return err;
}
+ dom_node_unref(tmp);
}
- dom_node_unref(tmp);
-
return DOM_NO_ERR;
}