mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-24 10:24:36 +03:00
box_construct: Do not leak attributes in <embed> boxes
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
14c7b4aee3
commit
9a02a41cd6
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user