From 40e7a9867d21f748b28b4e99df27755af84436b8 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 16 May 2016 12:35:42 -0400 Subject: [PATCH] common: release uv_fs_scandir() array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uv__fs_scandir_cleanup() releases individual directory entries, but not the container array. This commit frees the array as well. 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/uv-common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/uv-common.c b/src/uv-common.c index e311f32c..ba264469 100644 --- a/src/uv-common.c +++ b/src/uv-common.c @@ -503,6 +503,9 @@ void uv__fs_scandir_cleanup(uv_fs_t* req) { (*nbufs)--; for (; *nbufs < (unsigned int) req->result; (*nbufs)++) uv__fs_scandir_free(dents[*nbufs]); + + uv__fs_scandir_free(req->ptr); + req->ptr = NULL; }