diff options
author | Jeremy Henty <onepoint@starurchin.org> | 2009-02-01 14:16:26 -0300 |
---|---|---|
committer | Jeremy Henty <onepoint@starurchin.org> | 2009-02-01 14:16:26 -0300 |
commit | 3bdea1e9633b97f5c9d60ddb819c38f0f5778e0a (patch) | |
tree | f162cb799582d704a4f5d66befe274abf0cd28c1 /src | |
parent | df866ade99bea5fab0c05dc205588580a7ba71b6 (diff) |
Fixed a leak in Html_tag_open_link()
Diffstat (limited to 'src')
-rw-r--r-- | src/html.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/html.cc b/src/html.cc index 20685080..769379a5 100644 --- a/src/html.cc +++ b/src/html.cc @@ -2850,11 +2850,10 @@ static void Html_tag_open_link(DilloHtml *html, const char *tag, int tagsize) return; /* CSS stylesheet link */ - if ((!(attrbuf = a_Html_get_attr(html, tag, tagsize, "rel")) || - dStrcasecmp(attrbuf, "stylesheet")) || - (!(attrbuf = a_Html_get_attr(html, tag, tagsize, "href")) || - !(url = a_Html_url_new(html, attrbuf, NULL, 0)))) + if (!(attrbuf = a_Html_get_attr(html, tag, tagsize, "rel")) || + dStrcasecmp(attrbuf, "stylesheet")) return; + /* IMPLIED attributes? */ if (((attrbuf = a_Html_get_attr(html, tag, tagsize, "type")) && dStrcasecmp(attrbuf, "text/css")) || @@ -2862,6 +2861,10 @@ static void Html_tag_open_link(DilloHtml *html, const char *tag, int tagsize) !dStristr(attrbuf, "screen") && dStrcasecmp(attrbuf, "all"))) return; + if (!(attrbuf = a_Html_get_attr(html, tag, tagsize, "href")) || + !(url = a_Html_url_new(html, attrbuf, NULL, 0))) + return; + MSG(" Html_tag_open_link(): URL=%s\n", URL_STR(url)); _MSG(" repush after HEAD=%d\n", html->repush_after_head); |