mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
setopt: free the previous STRING_ENCODING before storing the new
Follow-up to 6b9c75e219
Fixes #20179
Reported-by: correctmost on github
Closes #20180
This commit is contained in:
parent
eb7f5b71e5
commit
3c8f9c9247
@ -1725,8 +1725,10 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option,
|
||||
*/
|
||||
if(ptr && !*ptr) {
|
||||
ptr = Curl_get_content_encodings();
|
||||
if(ptr)
|
||||
if(ptr) {
|
||||
curlx_free(s->str[STRING_ENCODING]);
|
||||
s->str[STRING_ENCODING] = ptr;
|
||||
}
|
||||
else
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
return result;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user