The problem happen because the iterator after erasing the element will be
invalid.
The patch fix to increase the iterator before delete client
---
src/log/logd/lgs_evt.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/log/logd/lgs_evt.cc b/src/log/logd/lgs_evt.cc
index 94a94b646..c01680c49 100644
--- a/src/log/logd/lgs_evt.cc
+++ b/src/log/logd/lgs_evt.cc
@@ -333,9 +333,9 @@ int lgs_client_delete_by_mds_dest(MDS_DEST mds_dest, time_t
*closetime_ptr) {
TRACE_ENTER2("mds_dest %" PRIx64, mds_dest);
/* Loop through Client DB */
ClientMap *clientMap(reinterpret_cast<ClientMap *>(client_db));
- for (const auto &value : *clientMap) {
- rp = value.second;
-
+ for (auto it = clientMap->begin(); it != clientMap->end(); ) {
+ rp = it->second;
+ it++;
if (m_NCS_MDS_DEST_EQUAL(&rp->mds_dest, &mds_dest))
rc = lgs_client_delete(rp->client_id, closetime_ptr);
}
--
2.13.0
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel