mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
curl: fix memory leak reading --writeout from file
If another string had been set first, the writout function for reading the syntax from file would leak the previously allocated memory. Reported-by: Brian Carpenter Fixes #3322 Closes #3330
This commit is contained in:
parent
8e2549b86c
commit
650281ed5b
@ -2066,6 +2066,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||
fname = nextarg;
|
||||
file = fopen(nextarg, FOPEN_READTEXT);
|
||||
}
|
||||
Curl_safefree(config->writeout);
|
||||
err = file2string(&config->writeout, file);
|
||||
if(file && (file != stdin))
|
||||
fclose(file);
|
||||
|
Loading…
Reference in New Issue
Block a user