← Commit list

29dfc0238c

Daniel Stenberg
Daniel Stenberg
2026-03-24
SUCCESS Duration: 254s

Subject

tool_getparam: use correct free function for libcurl memory

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 →

src/tool_getparam.c+5 -1
@@ -727,7 +727,11 @@ static ParameterError data_urlencode(const char *nextarg,
size = curlx_dyn_len(&dyn);
}
else {
- n = enc;
+ /* make sure we return "our memory" */
+ n = curlx_strdup(enc);
+ curl_free(enc);
+ if(!n)
+ return PARAM_NO_MEM;
size = strlen(n);
}
postdata = n;