From 0098a8528376638b23ddba074649addbd88b62b9 Mon Sep 17 00:00:00 2001 From: Johann Saunier <1763341+jjsaunier@users.noreply.github.com> Date: Wed, 28 Feb 2024 16:06:54 +0100 Subject: [PATCH 1/2] Fix memleak and reset option Mainly backported from https://github.com/lwthiker/curl-impersonate/pull/221 --- src/tool_cfgable.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index 3a492996b986d3..95682b2a5f5aa8 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -95,6 +95,17 @@ static void free_config_fields(struct OperationConfig *config) Curl_safefree(config->proto_str); Curl_safefree(config->proto_redir_str); + // Impersonate + Curl_safefree(config->ssl_sig_hash_algs); + Curl_safefree(config->ssl_cert_compression); + Curl_safefree(config->http2_pseudo_headers_order); + Curl_safefree(config->http2_settings); + Curl_safefree(config->http2_streams); + + config->ssl_permute_extensions = NULL; + config->http2_window_update = -1; + // End Impersonate + urlnode = config->url_list; while(urlnode) { struct getout *next = urlnode->next; From 9d12d9a179fc4202d9b309517beb8b0cc0353797 Mon Sep 17 00:00:00 2001 From: Johann Saunier <1763341+jjsaunier@users.noreply.github.com> Date: Wed, 28 Feb 2024 16:12:23 +0100 Subject: [PATCH 2/2] Update tool_cfgable.c --- src/tool_cfgable.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index 95682b2a5f5aa8..7d42e487bff7ab 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -101,9 +101,6 @@ static void free_config_fields(struct OperationConfig *config) Curl_safefree(config->http2_pseudo_headers_order); Curl_safefree(config->http2_settings); Curl_safefree(config->http2_streams); - - config->ssl_permute_extensions = NULL; - config->http2_window_update = -1; // End Impersonate urlnode = config->url_list;