← Commit list

9308ea22e8

Daniel Stenberg
Daniel Stenberg
2025-10-28
SUCCESS Duration: 147s

Subject

cookie: remove the temporary file on (all) errors

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/cookie.c+4 -2
@@ -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;
}