Fix file() command descriptor leak on error
Credit goes to "cppcheck". Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
This commit is contained in:
parent
f47393c66b
commit
4868921bc2
|
@ -2982,6 +2982,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
|
||||||
std::string errStr = "UPLOAD cannot stat file '";
|
std::string errStr = "UPLOAD cannot stat file '";
|
||||||
errStr += filename + "'.";
|
errStr += filename + "'.";
|
||||||
this->SetError(errStr.c_str());
|
this->SetError(errStr.c_str());
|
||||||
|
fclose(fin);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2991,6 +2992,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
|
||||||
if(!curl)
|
if(!curl)
|
||||||
{
|
{
|
||||||
this->SetError("UPLOAD error initializing curl.");
|
this->SetError("UPLOAD error initializing curl.");
|
||||||
|
fclose(fin);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue