diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-12-01 23:42:03 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-12-01 23:42:03 +0000 |
commit | 6513303498d36b08d2ae815311248ed818cf668e (patch) | |
tree | d4390e940515d2d349de45de2492b8e18dadfd9d /lib | |
parent | 3e2a52b0342d1e4e17e6c455442c6262f742a0d5 (diff) |
Jamie Newton pointed out that libcurl's file:// code would close() a zero
file descriptor if given a non-existing file.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/file.c b/lib/file.c index c325a4673..dbfe81cfa 100644 --- a/lib/file.c +++ b/lib/file.c @@ -158,12 +158,12 @@ CURLcode Curl_file_connect(struct connectdata *conn) #endif file->freepath = real_path; /* free this when done */ + file->fd = fd; if(!conn->data->set.upload && (fd == -1)) { failf(conn->data, "Couldn't open file %s", conn->path); Curl_file_done(conn, CURLE_FILE_COULDNT_READ_FILE); return CURLE_FILE_COULDNT_READ_FILE; } - file->fd = fd; return CURLE_OK; } |