summaryrefslogtreecommitdiff
path: root/src/html/html_document.c
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2018-08-03 14:18:50 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2018-08-03 14:18:50 +0100
commit6edaed28d6b9de140557d2b58113cc784f7ce7e8 (patch)
tree76ee45bff12603f188e6e5e16aa0004067d1189a /src/html/html_document.c
parent584be5d50fa206e2d8772db4b3b5c231efc41c66 (diff)
downloadlibdom-6edaed28d6b9de140557d2b58113cc784f7ce7e8.tar.gz
libdom-6edaed28d6b9de140557d2b58113cc784f7ce7e8.tar.bz2
HTMLDocument: Squash leaks of document.documentElement.
Diffstat (limited to 'src/html/html_document.c')
-rw-r--r--src/html/html_document.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/html/html_document.c b/src/html/html_document.c
index 9b749ae..9f53295 100644
--- a/src/html/html_document.c
+++ b/src/html/html_document.c
@@ -1184,8 +1184,10 @@ dom_exception _dom_html_document_get_images(dom_html_document *doc,
if (err != DOM_NO_ERR)
return err;
- return _dom_html_collection_create(doc, (dom_node_internal *) root,
+ err = _dom_html_collection_create(doc, (dom_node_internal *) root,
images_callback, doc, col);
+ dom_node_unref(root);
+ return err;
}
bool applet_callback(struct dom_node_internal * node, void *ctx)
@@ -1233,8 +1235,10 @@ dom_exception _dom_html_document_get_applets(dom_html_document *doc,
if (err != DOM_NO_ERR)
return err;
- return _dom_html_collection_create(doc, (dom_node_internal *) root,
+ err = _dom_html_collection_create(doc, (dom_node_internal *) root,
applets_callback, doc, col);
+ dom_node_unref(root);
+ return err;
}
/**
@@ -1276,8 +1280,10 @@ dom_exception _dom_html_document_get_links(dom_html_document *doc,
if (err != DOM_NO_ERR)
return err;
- return _dom_html_collection_create(doc, (dom_node_internal *) root,
+ err = _dom_html_collection_create(doc, (dom_node_internal *) root,
links_callback, doc, col);
+ dom_node_unref(root);
+ return err;
}
static bool __dom_html_document_node_is_form(dom_node_internal *node,
@@ -1352,8 +1358,10 @@ dom_exception _dom_html_document_get_anchors(dom_html_document *doc,
if (err != DOM_NO_ERR)
return err;
- return _dom_html_collection_create(doc, (dom_node_internal *) root,
+ err = _dom_html_collection_create(doc, (dom_node_internal *) root,
anchors_callback, doc, col);
+ dom_node_unref(root);
+ return err;
}
dom_exception _dom_html_document_get_cookie(dom_html_document *doc,