mirror of
https://github.com/curl/curl.git
synced 2026-07-23 19:27:17 +03:00
David Byron found a problem multiple -d options when libcurl was built with
--enable-debug, as then curl used free() on memory allocated both with normal malloc() and with libcurl-provided functions, when the latter MUST be freed with curl_free() in debug builds.
This commit is contained in:
parent
d74725ce67
commit
f17d9bba14
3 changed files with 14 additions and 2 deletions
|
|
@ -1892,7 +1892,11 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
/* we already have a string, we append this one
|
||||
with a separating &-letter */
|
||||
char *oldpost=config->postfields;
|
||||
config->postfields=aprintf("%s&%s", oldpost, postdata);
|
||||
size_t newlen = strlen(oldpost) + strlen(postdata) + 2;
|
||||
config->postfields=malloc(newlen);
|
||||
if(!config->postfields)
|
||||
return PARAM_NO_MEM;
|
||||
snprintf(config->postfields, newlen, "%s&%s", oldpost, postdata);
|
||||
free(oldpost);
|
||||
free(postdata);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue