Fix memory leak on location rewrite in rev_proxy

This commit is contained in:
2022-08-16 21:03:50 +02:00
parent abe0e326cb
commit b6ba58d406
4 changed files with 31 additions and 33 deletions

View File

@ -498,9 +498,7 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int
const char *content_type = http_get_header_field(&res.hdr, "Content-Type");
const char *content_length_f = http_get_header_field(&res.hdr, "Content-Length");
const char *content_encoding = http_get_header_field(&res.hdr, "Content-Encoding");
if (content_encoding == NULL && content_type != NULL && content_length_f != NULL &&
strncmp(content_type, "text/html", 9) == 0)
{
if (content_encoding == NULL && content_type != NULL && content_length_f != NULL && strncmp(content_type, "text/html", 9) == 0) {
long content_len = strtol(content_length_f, NULL, 10);
if (content_len <= sizeof(msg_content) - 1) {
ctx.status = res.status->code;