win: fix memory leak inside uv_fs_access()

PR-URL: https://github.com/libuv/libuv/pull/1263
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Andreas Hauptmann 2017-03-20 18:27:54 +01:00 committed by cjihrig
parent cd676e2dbc
commit cd937833a7

View File

@ -1371,7 +1371,7 @@ static void fs__access(uv_fs_t* req) {
* - or it's a directory.
* (Directories cannot be read-only on Windows.)
*/
if (!(req->flags & W_OK) ||
if (!(req->fs.info.mode & W_OK) ||
!(attr & FILE_ATTRIBUTE_READONLY) ||
(attr & FILE_ATTRIBUTE_DIRECTORY)) {
SET_REQ_RESULT(req, 0);
@ -2398,7 +2398,7 @@ int uv_fs_access(uv_loop_t* loop,
if (err)
return uv_translate_sys_error(err);
req->flags = flags;
req->fs.info.mode = flags;
if (cb) {
QUEUE_FS_TP_JOB(loop, req);