diff --git a/CHANGES b/CHANGES index 7e15f7b707..aae934fa10 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ +2.3-695 | 2015-04-13 10:34:42 -0500 + + * Fix iterator invalidation in broker::Manager dtor. (Jon Siwek) + + * Add paragraph to plugin documentation. (Robin Sommer) + 2.3-693 | 2015-04-11 10:56:31 -0700 * BIT-1367: improve coercion of anonymous records in set constructor. @@ -6,7 +12,6 @@ * Allow to specify ports for sftp log rotator. (Johanna Amann) - 2.3-690 | 2015-04-10 21:51:10 -0700 * Make sure to always delete the remote serializer. Addresses diff --git a/VERSION b/VERSION index 0cb2197cc6..8b0e511288 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3-693 +2.3-695 diff --git a/src/broker/Manager.cc b/src/broker/Manager.cc index ae00134af5..e467137c65 100644 --- a/src/broker/Manager.cc +++ b/src/broker/Manager.cc @@ -26,8 +26,15 @@ int bro_broker::Manager::send_flags_unsolicited_idx; bro_broker::Manager::~Manager() { + vector stores_to_close; + for ( auto& s : data_stores ) - CloseStore(s.first.first, s.first.second); + stores_to_close.emplace_back(s.first); + + for ( auto& s : stores_to_close ) + // This doesn't loop directly over data_stores, because CloseStore + // modifies the map and invalidates iterators. + CloseStore(s.first, s.second); } static int require_field(RecordType* rt, const char* name)