ensure imagemap lists are freed on error paths (coverity 1109880)

This commit is contained in:
Vincent Sanders 2014-01-24 12:11:10 +00:00
parent b38dfd7939
commit b7e372cf84
1 changed files with 6 additions and 0 deletions

View File

@ -304,6 +304,10 @@ imagemap_extract(html_content *c)
if (name != NULL) {
struct mapentry *entry = NULL;
if (imagemap_extract_map(node, c, &entry) == false) {
if (entry != NULL) {
imagemap_freelist(entry);
}
dom_string_unref(name);
dom_node_unref(node);
ret = NSERROR_NOMEM; /** @todo check this */
@ -317,6 +321,8 @@ imagemap_extract(html_content *c)
*/
if ((entry != NULL) &&
(imagemap_add(c, name, entry) == false)) {
imagemap_freelist(entry);
dom_string_unref(name);
dom_node_unref(node);
ret = NSERROR_NOMEM; /** @todo check this */