Permalink
Browse files

fix leak in readPipeline logic

  • Loading branch information...
1 parent 3582245 commit 5fc55ca454f3bc11f43a13c09a9c112d64515114 @mpgerlek mpgerlek committed May 9, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/PipelineReader.cpp
View
@@ -569,7 +569,17 @@ bool PipelineReader::readPipeline(const std::string& filename)
std::istream* input = FileUtils::openFile(filename);
- bool isWriter = readPipeline(*input);
+ bool isWriter = false;
+
+ try
+ {
+ isWriter = readPipeline(*input);
+ }
+ catch (...)
+ {
+ FileUtils::closeFile(input);
+ throw;
+ }
FileUtils::closeFile(input);

0 comments on commit 5fc55ca

Please sign in to comment.