mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fix resource leak.
* src/http.c (parse_strict_transport_security): Freed memory to avoid resource leak. Comply with GNU coding style.
This commit is contained in:
parent
2d2ddb25d8
commit
d080a70a3a
@ -1273,9 +1273,9 @@ parse_strict_transport_security (const char *header, time_t *max_age, bool *incl
|
|||||||
/* Process the STS header. Keys should be matched case-insensitively. */
|
/* Process the STS header. Keys should be matched case-insensitively. */
|
||||||
for (; extract_param (&header, &name, &value, ';', &is_url_encoded); is_url_encoded = false)
|
for (; extract_param (&header, &name, &value, ';', &is_url_encoded); is_url_encoded = false)
|
||||||
{
|
{
|
||||||
if (BOUNDED_EQUAL_NO_CASE(name.b, name.e, "max-age"))
|
if (BOUNDED_EQUAL_NO_CASE (name.b, name.e, "max-age"))
|
||||||
c_max_age = strdupdelim (value.b, value.e);
|
c_max_age = strdupdelim (value.b, value.e);
|
||||||
else if (BOUNDED_EQUAL_NO_CASE(name.b, name.e, "includeSubDomains"))
|
else if (BOUNDED_EQUAL_NO_CASE (name.b, name.e, "includeSubDomains"))
|
||||||
is = true;
|
is = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1291,9 +1291,10 @@ parse_strict_transport_security (const char *header, time_t *max_age, bool *incl
|
|||||||
if (include_subdomains)
|
if (include_subdomains)
|
||||||
*include_subdomains = is;
|
*include_subdomains = is;
|
||||||
|
|
||||||
DEBUGP(("Parsed Strict-Transport-Security max-age = %s, includeSubDomains = %s\n",
|
DEBUGP (("Parsed Strict-Transport-Security max-age = %s, includeSubDomains = %s\n",
|
||||||
c_max_age, (is ? "true" : "false")));
|
c_max_age, (is ? "true" : "false")));
|
||||||
|
|
||||||
|
xfree (c_max_age);
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user