Skip to content
Snippets Groups Projects
Commit 3f427f5a authored by Rafaël Carré's avatar Rafaël Carré
Browse files

remove call from callmap before terminating it, avoid use after free

parent 3c039662
Branches
Tags
No related merge requests found
......@@ -55,20 +55,15 @@ bool VoIPLink::addCall (Call* call)
return false;
}
bool VoIPLink::removeCall (const std::string& id)
void VoIPLink::removeCall (const std::string& id)
{
ost::MutexLock m (_callMapMutex);
_debug ("VoipLink: delete call");
terminateCall (id);
_debug ("VoipLink: removing call %s from list", id.c_str());
if (_callMap.erase (id)) {
return true;
}
_callMap.erase (id);
return false;
terminateCall (id);
}
Call* VoIPLink::getCall (const std::string& id)
......
......@@ -211,9 +211,8 @@ class VoIPLink
/** Remove a call from the call map (protected by mutex)
* @param id A Call ID
* @return bool True if the call was correctly removed
*/
bool removeCall (const std::string& id);
void removeCall (const std::string& id);
/**
* Remove all the call from the map
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment