Fixing coverity issue 1046672 and a potential memory leak
This commit is contained in:
parent
8de4613a3e
commit
149a42cc94
@ -88,7 +88,10 @@ OSRM::~OSRM() {
|
|||||||
|
|
||||||
void OSRM::RegisterPlugin(BasePlugin * plugin) {
|
void OSRM::RegisterPlugin(BasePlugin * plugin) {
|
||||||
SimpleLogger().Write() << "loaded plugin: " << plugin->GetDescriptor();
|
SimpleLogger().Write() << "loaded plugin: " << plugin->GetDescriptor();
|
||||||
pluginMap[plugin->GetDescriptor()] = plugin;
|
if( pluginMap.find(plugin->GetDescriptor()) != pluginMap.end() ) {
|
||||||
|
delete pluginMap[plugin->GetDescriptor()];
|
||||||
|
}
|
||||||
|
pluginMap.insert(std::make_pair(plugin->GetDescriptor(), plugin));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSRM::RunQuery(RouteParameters & route_parameters, http::Reply & reply) {
|
void OSRM::RunQuery(RouteParameters & route_parameters, http::Reply & reply) {
|
||||||
|
Loading…
Reference in New Issue
Block a user