From 59530d9decf1a7aefc57a43085a80454adfa9958 Mon Sep 17 00:00:00 2001 From: Bo Rydberg Date: Sun, 1 Mar 2020 17:40:41 -0500 Subject: cmGeneratedFileStream: File resource leak if oldname not found --- Source/cmGeneratedFileStream.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index 2af04b6..f76e205 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -180,6 +180,7 @@ int cmGeneratedFileStreamBase::CompressFile(std::string const& oldname, } FILE* ifs = cmsys::SystemTools::Fopen(oldname, "r"); if (!ifs) { + gzclose(gf); return 0; } size_t res; -- cgit v0.12