Skip to content

Commit

Permalink
TextReader::initialize(): fix memleak if parseHeader() throws excepti…
Browse files Browse the repository at this point in the history
…on (#2952)
  • Loading branch information
rouault committed Feb 29, 2020
1 parent 36fd7fc commit c15d241
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion io/TextReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,15 @@ void TextReader::initialize(PointTableRef table)
checkHeader(header);
}

parseHeader(header);
try
{
parseHeader(header);
}
catch( const pdal_error& )
{
Utils::closeFile(m_istream);
throw;
}
Utils::closeFile(m_istream);
}

Expand Down

0 comments on commit c15d241

Please sign in to comment.