win: call uv__fs_scandir_cleanup()

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 <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
cjihrig 2016-05-16 13:15:36 -04:00
parent 40e7a9867d
commit 4e4407b17e

View File

@ -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;