summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBo Rydberg <kitware@rydb3rg.com>2020-03-01 22:40:41 (GMT)
committerBo Rydberg <kitware@rydb3rg.com>2020-03-01 22:40:41 (GMT)
commit59530d9decf1a7aefc57a43085a80454adfa9958 (patch)
tree872ee947ede7752a57271d3426bee208231a6122
parent61596e1cc861f975ec822f72d34842674b388646 (diff)
downloadCMake-59530d9decf1a7aefc57a43085a80454adfa9958.zip
CMake-59530d9decf1a7aefc57a43085a80454adfa9958.tar.gz
CMake-59530d9decf1a7aefc57a43085a80454adfa9958.tar.bz2
cmGeneratedFileStream: File resource leak if oldname not found
-rw-r--r--Source/cmGeneratedFileStream.cxx1
1 files changed, 1 insertions, 0 deletions
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;