mirror of
https://github.com/curl/curl.git
synced 2026-05-30 08:27:28 +03:00
cookie: remove the temporary file on (all) errors
Fixes #19267 Reported-by: Harry Sintonen Closes #19268
This commit is contained in:
parent
02113a6307
commit
9308ea22e8
1 changed files with 4 additions and 2 deletions
|
|
@ -1595,7 +1595,6 @@ static CURLcode cookie_output(struct Curl_easy *data,
|
|||
curlx_fclose(out);
|
||||
out = NULL;
|
||||
if(tempstore && Curl_rename(tempstore, filename)) {
|
||||
unlink(tempstore);
|
||||
error = CURLE_WRITE_ERROR;
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -1612,7 +1611,10 @@ static CURLcode cookie_output(struct Curl_easy *data,
|
|||
error:
|
||||
if(out && !use_stdout)
|
||||
curlx_fclose(out);
|
||||
free(tempstore);
|
||||
if(tempstore) {
|
||||
unlink(tempstore);
|
||||
free(tempstore);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue