summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-11-30 20:36:48 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-11-30 20:37:07 +0000
commit9a02a41cd61d7fa4a58d234e7240ff41205a7e54 (patch)
tree8a557aa345d4760a74d1cce78fa0b01bf9eba575 /content
parent14c7b4aee30462db6488c6084a64ce40aaaef6a1 (diff)
downloadnetsurf-9a02a41cd61d7fa4a58d234e7240ff41205a7e54.tar.gz
netsurf-9a02a41cd61d7fa4a58d234e7240ff41205a7e54.tar.bz2
box_construct: Do not leak attributes in <embed> boxes
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'content')
-rw-r--r--content/handlers/html/box_construct.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/content/handlers/html/box_construct.c b/content/handlers/html/box_construct.c
index f0d68ac2e..50d102729 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -2998,17 +2998,20 @@ bool box_embed(BOX_SPECIAL_PARAMS)
err = dom_attr_get_name(attr, &name);
if (err != DOM_NO_ERR) {
+ dom_node_unref(attr);
dom_namednodemap_unref(attrs);
return false;
}
if (dom_string_caseless_lwc_isequal(name, corestring_lwc_src)) {
+ dom_node_unref(attr);
dom_string_unref(name);
continue;
}
err = dom_attr_get_value(attr, &value);
if (err != DOM_NO_ERR) {
+ dom_node_unref(attr);
dom_string_unref(name);
dom_namednodemap_unref(attrs);
return false;
@@ -3016,6 +3019,7 @@ bool box_embed(BOX_SPECIAL_PARAMS)
param = talloc(content->bctx, struct object_param);
if (param == NULL) {
+ dom_node_unref(attr);
dom_string_unref(value);
dom_string_unref(name);
dom_namednodemap_unref(attrs);
@@ -3030,6 +3034,7 @@ bool box_embed(BOX_SPECIAL_PARAMS)
dom_string_unref(value);
dom_string_unref(name);
+ dom_node_unref(attr);
if (param->name == NULL || param->value == NULL ||
param->valuetype == NULL) {