← Commit list

3c8f9c9247

Daniel Stenberg
Daniel Stenberg
2026-01-04
SUCCESS Duration: 388s

Subject

setopt: free the previous STRING_ENCODING before storing the new

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/setopt.c+3 -1
@@ -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;