From b6ca4a7a46f49588898c4b129397384523861fff Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Thu, 1 May 2014 14:48:06 +0200 Subject: [PATCH] fix potential resource leak --- Contractor/GeometryCompressor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Contractor/GeometryCompressor.cpp b/Contractor/GeometryCompressor.cpp index e0d5752d0..f7574ab15 100644 --- a/Contractor/GeometryCompressor.cpp +++ b/Contractor/GeometryCompressor.cpp @@ -147,7 +147,9 @@ void GeometryCompressor::CompressEdge(const EdgeID edge_id_1, m_free_list.pop_back(); } - const unsigned edge_bucket_id1 = m_edge_id_to_list_index_map[edge_id_1]; + const boost::unordered_map::const_iterator iter = m_edge_id_to_list_index_map.find(edge_id_1); + BOOST_ASSERT(iter != m_edge_id_to_list_index_map.end()); + const unsigned edge_bucket_id1 = iter->second; BOOST_ASSERT(edge_bucket_id1 == GetPositionForID(edge_id_1)); BOOST_ASSERT(edge_bucket_id1 < m_compressed_geometries.size());