From: Fabian Keil Date: Tue, 9 Sep 2025 12:42:54 +0000 (+0200) Subject: error_response(): Prevent a theoretical memory leak X-Git-Url: http://www.privoxy.org/gitweb/@user-manual@actions-file.html?a=commitdiff_plain;h=385858ba35157fec669918544f3264c94152a5cd;p=privoxy.git error_response(): Prevent a theoretical memory leak Reported by Joshua Rogers. --- diff --git a/cgi.c b/cgi.c index 4cffc924..91ea06e9 100644 --- a/cgi.c +++ b/cgi.c @@ -914,9 +914,9 @@ struct http_response *error_response(struct client_state *csp, } err = string_append(&path, csp->http->path); + if (!err) err = map(exports, "path", 1, html_encode_and_free_original(path), 0); if (!err) err = map(exports, "host", 1, html_encode(csp->http->host), 0); if (!err) err = map(exports, "hostport", 1, html_encode(csp->http->hostport), 0); - if (!err) err = map(exports, "path", 1, html_encode_and_free_original(path), 0); if (!err) err = map(exports, "protocol", 1, csp->http->ssl ? "https://" : "http://", 1); if (!err) {