summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-12-14 23:55:37 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-12-15 08:28:38 +0100
commit614f78131ad7db715ab8279f4a8af9bf0b2b4789 (patch)
tree0ef7026a8cc4f92326bfa20cdc6c5dd9654d40c5 /src
parent24d494c26451d12f2c2283f4f4b89cf3bd8dd548 (diff)
downloadcurl-614f78131ad7db715ab8279f4a8af9bf0b2b4789.tar.gz
tool_paramhlp: free the proto strings on exit
And also make sure that repeated use of the options free the previous string before it stores a new. Follow-up from e6f8445edef8e7996d Closes #10098
Diffstat (limited to 'src')
-rw-r--r--src/tool_cfgable.c2
-rw-r--r--src/tool_paramhlp.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c
index 21c0cc19c..470204573 100644
--- a/src/tool_cfgable.c
+++ b/src/tool_cfgable.c
@@ -90,6 +90,8 @@ static void free_config_fields(struct OperationConfig *config)
Curl_safefree(config->netrc_file);
Curl_safefree(config->output_dir);
+ Curl_safefree(config->proto_str);
+ Curl_safefree(config->proto_redir_str);
urlnode = config->url_list;
while(urlnode) {
diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c
index ae9fb1377..c4fd0a192 100644
--- a/src/tool_paramhlp.c
+++ b/src/tool_paramhlp.c
@@ -433,6 +433,7 @@ ParameterError proto2num(struct OperationConfig *config,
result = curlx_dyn_addf(&obuf, "%s,", protoset[proto]);
free((char *) protoset);
curlx_dyn_setlen(&obuf, curlx_dyn_len(&obuf) - 1);
+ free(*ostr);
*ostr = curlx_dyn_ptr(&obuf);
return *ostr ? PARAM_OK : PARAM_NO_MEM;