box_construct: Do not leak attributes in <embed> boxes

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-11-30 20:36:48 +00:00
parent 14c7b4aee3
commit 9a02a41cd6
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
1 changed files with 5 additions and 0 deletions

View File

@ -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) {