mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-11 05:19:18 +03:00
ensure imagemap lists are freed on error paths (coverity 1109880)
This commit is contained in:
parent
b38dfd7939
commit
b7e372cf84
@ -304,6 +304,10 @@ imagemap_extract(html_content *c)
|
|||||||
if (name != NULL) {
|
if (name != NULL) {
|
||||||
struct mapentry *entry = NULL;
|
struct mapentry *entry = NULL;
|
||||||
if (imagemap_extract_map(node, c, &entry) == false) {
|
if (imagemap_extract_map(node, c, &entry) == false) {
|
||||||
|
if (entry != NULL) {
|
||||||
|
imagemap_freelist(entry);
|
||||||
|
}
|
||||||
|
|
||||||
dom_string_unref(name);
|
dom_string_unref(name);
|
||||||
dom_node_unref(node);
|
dom_node_unref(node);
|
||||||
ret = NSERROR_NOMEM; /** @todo check this */
|
ret = NSERROR_NOMEM; /** @todo check this */
|
||||||
@ -317,6 +321,8 @@ imagemap_extract(html_content *c)
|
|||||||
*/
|
*/
|
||||||
if ((entry != NULL) &&
|
if ((entry != NULL) &&
|
||||||
(imagemap_add(c, name, entry) == false)) {
|
(imagemap_add(c, name, entry) == false)) {
|
||||||
|
imagemap_freelist(entry);
|
||||||
|
|
||||||
dom_string_unref(name);
|
dom_string_unref(name);
|
||||||
dom_node_unref(node);
|
dom_node_unref(node);
|
||||||
ret = NSERROR_NOMEM; /** @todo check this */
|
ret = NSERROR_NOMEM; /** @todo check this */
|
||||||
|
Loading…
Reference in New Issue
Block a user