Fix ref counting issue in HEAD handler. Fix logic error too.

This commit is contained in:
Michael Drake 2012-07-22 21:31:30 +01:00
parent 209d3a5ccf
commit d70bf9ac43
1 changed files with 10 additions and 6 deletions

View File

@ -744,18 +744,22 @@ static bool html_head(html_content *c, dom_node *head)
if ((exc == DOM_NO_ERR) && (node_type == DOM_ELEMENT_NODE)) { if ((exc == DOM_NO_ERR) && (node_type == DOM_ELEMENT_NODE)) {
exc = dom_node_get_node_name(node, &node_name); exc = dom_node_get_node_name(node, &node_name);
if ((exc == DOM_NO_ERR) || (node_name != NULL)) { if ((exc == DOM_NO_ERR) && (node_name != NULL)) {
if (dom_string_caseless_isequal(node_name, if (dom_string_caseless_isequal(node_name,
html_dom_string_title)) { html_dom_string_title)) {
html_process_title(c, node); html_process_title(c, node);
} else if (dom_string_caseless_isequal(node_name, } else if (dom_string_caseless_isequal(
html_dom_string_base)) { node_name,
html_dom_string_base)) {
html_process_base(c, node); html_process_base(c, node);
} else if (dom_string_caseless_isequal(node_name, } else if (dom_string_caseless_isequal(
html_dom_string_link)) { node_name,
html_dom_string_link)) {
html_process_link(c, node); html_process_link(c, node);
} }
} }
if (node_name != NULL)
dom_string_unref(node_name);
} }
/* move to next node */ /* move to next node */