From 4a1d13ae555b7b173ad0b3ca623b77da0a57c781 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Wed, 10 Apr 2019 15:59:37 -0400 Subject: [PATCH] Add missing closedir() in readdir() (dotnet/core-setup#5761) The readdir function calls opendir() but never closedir(), leaking the DIR resource. Commit migrated from https://github.com/dotnet/core-setup/commit/ad2e0c415a04e47be4343cc1e956166bfd244632 --- src/installer/corehost/common/pal.unix.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/installer/corehost/common/pal.unix.cpp b/src/installer/corehost/common/pal.unix.cpp index 5b5c42f..e0701d3 100644 --- a/src/installer/corehost/common/pal.unix.cpp +++ b/src/installer/corehost/common/pal.unix.cpp @@ -647,6 +647,8 @@ static void readdir(const pal::string_t& path, const pal::string_t& pattern, boo files.push_back(filepath); } } + + closedir(dir); } } -- 2.7.4