diff --git a/src/cssparser.cc b/src/cssparser.cc index 607467d..fcf9f5f 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -1610,9 +1610,8 @@ char * CssParser::parseUrl() } if (urlStr) { - DilloUrl *dilloUrl = a_Url_new(urlStr->str, a_Url_str(this->baseUrl)).release(); - char *url = dStrdup(a_Url_str(dilloUrl)); - delete dilloUrl; + auto dilloUrl = a_Url_new(urlStr->str, a_Url_str(this->baseUrl)); + char *url = dStrdup(a_Url_str(dilloUrl.get())); dStr_free(urlStr, 1); return url; } else { diff --git a/src/form.cc b/src/form.cc index dfeac39..b1bd537 100644 --- a/src/form.cc +++ b/src/form.cc @@ -572,7 +572,7 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize) */ void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize) { - DilloUrl *action; + std::unique_ptr< DilloUrl > action; Embed *embed; const char *attrbuf; @@ -582,9 +582,9 @@ void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize) } if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "action"))) - action = a_Html_url_new(html, attrbuf, NULL, 0).release(); + action = a_Html_url_new(html, attrbuf, NULL, 0); else - action = a_Url_dup(html->base_url).release(); + action = a_Url_dup(html->base_url); html->formNew(DILLO_HTML_METHOD_GET, action, DILLO_HTML_ENC_URLENCODED, html->charset.has_value() ? html->charset.value().c_str() : nullptr); @@ -603,7 +603,6 @@ void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize) HT2TB(html)->addWidget (embed, html->backgroundStyle ()); - delete action; html->InFlags &= ~IN_FORM; }