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
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) {
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;