summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-08-23 09:50:53 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2013-08-23 09:50:53 (GMT)
commit955cfb43a942899332b38059cc5c213f210825ca (patch)
tree3d98ae37695f9c7b04da241f768978e940aa2a39
parentdb1fd54ff3a1441a28360b48a020b42f6af7793b (diff)
downloadlibdom-955cfb43a942899332b38059cc5c213f210825ca.tar.gz
libdom-955cfb43a942899332b38059cc5c213f210825ca.tar.bz2
dom_document_get_element_by_id increments the ref counter of any returned element.
-rw-r--r--src/core/document.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/document.c b/src/core/document.c
index 8f316ff..22f08f1 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -820,6 +820,9 @@ dom_exception _dom_document_get_element_by_id(dom_document *doc,
err = _dom_find_element_by_id(root, id, result);
dom_node_unref(root);
+ if (*result != NULL)
+ dom_node_ref(*result);
+
return err;
}