← Commit list

0b182ae529

Daniel Stenberg
Daniel Stenberg
2026-03-20
SUCCESS Duration: 261s

Subject

file: init fd to -1 to prevent close fd 0 on early failure

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/file.c+2 -0
@@ -108,6 +108,8 @@ static CURLcode file_setup_connection(struct Curl_easy *data,
(void)conn;
/* allocate the FILE specific struct */
filep = curlx_calloc(1, sizeof(*filep));
+ if(filep)
+ filep->fd = -1;
if(!filep ||
Curl_meta_set(data, CURL_META_FILE_EASY, filep, file_easy_dtor))
return CURLE_OUT_OF_MEMORY;