mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
tool_getparam: use correct free function for libcurl memory
Memory returned from curl_easy_escape() should be fred with curl_free()
to avoid surprises.
Follow-up to f37840a46e
Spotted by Codex Security
Closes #21075
This commit is contained in:
parent
14712fa513
commit
29dfc0238c
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user