diff options
author | Thomas Jarosch <thomas.jarosch@intra2net.com> | 2011-09-01 19:57:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-09-02 15:15:26 (GMT) |
commit | 4868921bc2b5ad85221d51d585bb2116a2826915 (patch) | |
tree | aa6886cc966398b69d8250c48e7342be81f49c8e /Source/cmFileCommand.cxx | |
parent | f47393c66bb1810a9916fa755bc5830fb9d24d63 (diff) | |
download | CMake-4868921bc2b5ad85221d51d585bb2116a2826915.zip CMake-4868921bc2b5ad85221d51d585bb2116a2826915.tar.gz CMake-4868921bc2b5ad85221d51d585bb2116a2826915.tar.bz2 |
Fix file() command descriptor leak on error
Credit goes to "cppcheck".
Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r-- | Source/cmFileCommand.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 9a3de9b..3b63906 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2982,6 +2982,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args) std::string errStr = "UPLOAD cannot stat file '"; errStr += filename + "'."; this->SetError(errStr.c_str()); + fclose(fin); return false; } @@ -2991,6 +2992,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args) if(!curl) { this->SetError("UPLOAD error initializing curl."); + fclose(fin); return false; } |