summaryrefslogtreecommitdiff
path: root/src/html/html_document.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2014-11-15 10:13:54 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2014-11-15 10:13:54 +0000
commit89b61e8483cac27ea23c840d7a68c5243de97421 (patch)
tree7d4d374090ad7ffa74b25f76597b3ab1dcb2ad3d /src/html/html_document.c
parent0873c0f0b1e4ef9c276d88502f5b0de546c01619 (diff)
downloadlibdom-89b61e8483cac27ea23c840d7a68c5243de97421.tar.gz
libdom-89b61e8483cac27ea23c840d7a68c5243de97421.tar.bz2
Fix unref issue with html collection in applets callback. Coverity #1227072
Diffstat (limited to 'src/html/html_document.c')
-rw-r--r--src/html/html_document.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/html/html_document.c b/src/html/html_document.c
index f6808e7..ac0469c 100644
--- a/src/html/html_document.c
+++ b/src/html/html_document.c
@@ -757,10 +757,11 @@ bool applets_callback(struct dom_node_internal *node, void *ctx)
((dom_html_document *)ctx)->memoised[hds_OBJECT])) {
uint32_t len = 0;
dom_html_collection *applets;
- _dom_html_collection_create(ctx, node,
- applet_callback, ctx, &applets);
-
+ if (_dom_html_collection_create(ctx, node,
+ applet_callback, ctx, &applets) != DOM_NO_ERR)
+ return false;
dom_html_collection_get_length(applets, &len);
+ dom_html_collection_unref(applets);
if(len != 0)
return true;
}