From 4e4407b17ed375a56d4886d875647fc886a81224 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 16 May 2016 13:15:36 -0400 Subject: [PATCH] win: call uv__fs_scandir_cleanup() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a previously missing call to uv__fs_scandir_cleanup() to uv_fs_req_cleanup(). This better aligns the Windows and Unix implementations. Fixes: https://github.com/libuv/libuv/issues/873 PR-URL: https://github.com/libuv/libuv/pull/874 Reviewed-By: Ben Noordhuis Reviewed-By: Saúl Ibarra Corretgé --- src/win/fs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/win/fs.c b/src/win/fs.c index fd2547e9..54dfea72 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -1878,8 +1878,12 @@ void uv_fs_req_cleanup(uv_fs_t* req) { if (req->flags & UV_FS_FREE_PATHS) uv__free(req->file.pathw); - if (req->flags & UV_FS_FREE_PTR) - uv__free(req->ptr); + if (req->flags & UV_FS_FREE_PTR) { + if (req->fs_type == UV_FS_SCANDIR && req->ptr != NULL) + uv__fs_scandir_cleanup(req); + else + uv__free(req->ptr); + } req->path = NULL; req->file.pathw = NULL;