mirror of
https://github.com/reactos/CMake.git
synced 2024-11-24 20:19:53 +00:00
cmake: Fix resource leak reported by cppcheck
Return early in cmake::ReportUndefinedPropertyAccesses if there is no global generator instead of opening a file and leaking the descriptor. Reported-by: Ömer Fadıl USTA <omerusta@gmail.com>
This commit is contained in:
parent
c8adab9e43
commit
a20c819f63
@ -3667,11 +3667,11 @@ void cmake::RecordPropertyAccess(const char *name,
|
||||
|
||||
void cmake::ReportUndefinedPropertyAccesses(const char *filename)
|
||||
{
|
||||
if(!this->GlobalGenerator)
|
||||
{ return; }
|
||||
FILE *progFile = fopen(filename,"w");
|
||||
if (!progFile || !this->GlobalGenerator)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!progFile)
|
||||
{ return; }
|
||||
|
||||
// what are the enabled languages?
|
||||
std::vector<std::string> enLangs;
|
||||
|
Loading…
Reference in New Issue
Block a user