mirror of
https://github.com/moparisthebest/curl
synced 2025-03-01 01:41:50 -05:00
Fixed potential memory leak in OOM situations. Detected by coverity.com
This commit is contained in:
parent
b416b87518
commit
2688cf343b
@ -2313,6 +2313,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||
}
|
||||
else {
|
||||
char *enc = curl_easy_escape(config->easy, postdata, size);
|
||||
free(postdata); /* no matter if it worked or not */
|
||||
if(enc) {
|
||||
/* now make a string with the name from above and append the
|
||||
encoded string */
|
||||
@ -2325,7 +2326,6 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
|
||||
else
|
||||
strcpy(n, enc);
|
||||
curl_free(enc);
|
||||
free(postdata);
|
||||
if(n) {
|
||||
postdata = n;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user