------------------------------------------------------------ revno: 13801 revision-id: squid3@treenet.co.nz-20150420024144-srf1a3635zushydu parent: squid3@treenet.co.nz-20150420023820-i6ctas0bkablizjs author: Alex Rousskov committer: Amos Jeffries branch nick: 3.5 timestamp: Sun 2015-04-19 19:41:44 -0700 message: Do not increment an iterator invalidated by std::map::erase(). ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20150420024144-srf1a3635zushydu # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 5b852e44e80d7023837b4be368407861bd9b38a8 # timestamp: 2015-04-20 02:42:09 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20150420023820-\ # i6ctas0bkablizjs # # Begin patch === modified file 'src/ssl/context_storage.cc' --- src/ssl/context_storage.cc 2015-01-13 09:13:49 +0000 +++ src/ssl/context_storage.cc 2015-04-20 02:41:44 +0000 @@ -95,13 +95,14 @@ reconfiguring = false; // remove or change old local storages. - for (std::map::iterator i = storage.begin(); i != storage.end(); ++i) { + for (std::map::iterator i = storage.begin(); i != storage.end();) { std::map::iterator conf_i = configureStorage.find(i->first); if (conf_i == configureStorage.end() || conf_i->second <= 0) { delete i->second; - storage.erase(i); + storage.erase(i++); } else { i->second->setMemLimit(conf_i->second); + ++i; } }