diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2012-07-22 21:31:30 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2012-07-22 21:31:30 +0100 |
commit | d70bf9ac43c14809d4777af13fd82709c9548697 (patch) | |
tree | 8bef35cc76f370c43a662b69b970c4fa83afcb51 | |
parent | 209d3a5ccfdaa93402a557bdf335b8ea8d325cb6 (diff) | |
download | netsurf-d70bf9ac43c14809d4777af13fd82709c9548697.tar.gz netsurf-d70bf9ac43c14809d4777af13fd82709c9548697.tar.bz2 |
Fix ref counting issue in HEAD handler. Fix logic error too.
-rw-r--r-- | render/html.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/render/html.c b/render/html.c index ba9c9e79a..ce3e0184e 100644 --- a/render/html.c +++ b/render/html.c @@ -744,18 +744,22 @@ static bool html_head(html_content *c, dom_node *head) if ((exc == DOM_NO_ERR) && (node_type == DOM_ELEMENT_NODE)) { 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, - html_dom_string_title)) { + html_dom_string_title)) { html_process_title(c, node); - } else if (dom_string_caseless_isequal(node_name, - html_dom_string_base)) { + } else if (dom_string_caseless_isequal( + node_name, + html_dom_string_base)) { html_process_base(c, node); - } else if (dom_string_caseless_isequal(node_name, - html_dom_string_link)) { + } else if (dom_string_caseless_isequal( + node_name, + html_dom_string_link)) { html_process_link(c, node); } } + if (node_name != NULL) + dom_string_unref(node_name); } /* move to next node */ |