mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-24 00:40:11 -05:00
Fixed crash in RsDataService::retrieveNxsGrps
- accessing a deleted iterator. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6121 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
eb8d628d2a
commit
7413bdc50c
@ -654,6 +654,8 @@ int RsDataService::retrieveNxsGrps(std::map<std::string, RsNxsGrp *> &grp, bool
|
||||
RsStackMutex stack(mDbMutex);
|
||||
std::map<std::string, RsNxsGrp *>::iterator mit = grp.begin();
|
||||
|
||||
std::list<std::string> toRemove;
|
||||
|
||||
for(; mit != grp.end(); mit++)
|
||||
{
|
||||
const std::string& grpId = mit->first;
|
||||
@ -669,12 +671,18 @@ int RsDataService::retrieveNxsGrps(std::map<std::string, RsNxsGrp *> &grp, bool
|
||||
RsNxsGrp* ng = grps.front();
|
||||
grp[ng->grpId] = ng;
|
||||
}else{
|
||||
grp.erase(grpId);
|
||||
toRemove.push_back(grpId);
|
||||
}
|
||||
|
||||
delete c;
|
||||
}
|
||||
}
|
||||
|
||||
std::list<std::string>::iterator grpIdIt;
|
||||
for (grpIdIt = toRemove.begin(); grpIdIt != toRemove.end(); ++grpIdIt)
|
||||
{
|
||||
grp.erase(*grpIdIt);
|
||||
}
|
||||
}
|
||||
|
||||
if(withMeta)
|
||||
|
Loading…
x
Reference in New Issue
Block a user