fix coverity issue 1121924, Resource leak
This commit is contained in:
parent
9730526d33
commit
190def17e5
@ -231,54 +231,76 @@ inline bool GenerateServerProgramOptions(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !use_shared_memory ) {
|
if( !use_shared_memory ) {
|
||||||
if( !option_variables.count("hsgrdata") ) {
|
path_iterator = paths.find("hsgrdata");
|
||||||
if( !option_variables.count("base") ) {
|
if(
|
||||||
throw OSRMException("hsgrdata (or base) must be specified");
|
path_iterator == paths.end() ||
|
||||||
}
|
boost::filesystem::is_regular_file(path_iterator->second) ||
|
||||||
paths["hsgrdata"] = std::string( paths["base"].string()) + ".hsgr";
|
!option_variables.count("base")
|
||||||
|
) {
|
||||||
|
throw OSRMException("hsgrdata (or base) must be specified");
|
||||||
}
|
}
|
||||||
|
paths["hsgrdata"] = std::string( paths["base"].string()) + ".hsgr";
|
||||||
|
|
||||||
if(!option_variables.count("nodesdata")) {
|
path_iterator = paths.find("nodesdata");
|
||||||
if(!option_variables.count("base")) {
|
if(
|
||||||
throw OSRMException("nodesdata (or base) must be specified");
|
path_iterator == paths.end() ||
|
||||||
}
|
boost::filesystem::is_regular_file(path_iterator->second) ||
|
||||||
paths["nodesdata"] = std::string( paths["base"].c_str()) + ".nodes";
|
!option_variables.count("base")
|
||||||
|
) {
|
||||||
|
throw OSRMException("nodesdata (or base) must be specified");
|
||||||
}
|
}
|
||||||
|
paths["nodesdata"] = std::string( paths["base"].string()) + ".nodes";
|
||||||
|
|
||||||
if(!option_variables.count("edgesdata")) {
|
path_iterator = paths.find("edgesdata");
|
||||||
if(!option_variables.count("base")) {
|
if(
|
||||||
throw OSRMException("edgesdata (or base) must be specified");
|
path_iterator == paths.end() ||
|
||||||
}
|
boost::filesystem::is_regular_file(path_iterator->second) ||
|
||||||
paths["edgesdata"] = std::string( paths["base"].c_str()) + ".edges";
|
!option_variables.count("base")
|
||||||
|
) {
|
||||||
|
throw OSRMException("edgesdata (or base) must be specified");
|
||||||
}
|
}
|
||||||
|
paths["edgesdata"] = std::string( paths["base"].string()) + ".edges";
|
||||||
|
|
||||||
if(!option_variables.count("ramindex")) {
|
path_iterator = paths.find("ramindex");
|
||||||
if(!option_variables.count("base")) {
|
if(
|
||||||
throw OSRMException("ramindex (or base) must be specified");
|
path_iterator == paths.end() ||
|
||||||
}
|
boost::filesystem::is_regular_file(path_iterator->second) ||
|
||||||
paths["ramindex"] = std::string( paths["base"].c_str()) + ".ramIndex";
|
!option_variables.count("base")
|
||||||
|
) {
|
||||||
|
throw OSRMException("ramindex (or base) must be specified");
|
||||||
}
|
}
|
||||||
|
paths["ramindex"] = std::string( paths["base"].string()) + ".ramIndex";
|
||||||
|
|
||||||
if(!option_variables.count("fileindex")) {
|
path_iterator = paths.find("fileindex");
|
||||||
if(!option_variables.count("base")) {
|
if(
|
||||||
throw OSRMException("fileindex (or base) must be specified");
|
path_iterator == paths.end() ||
|
||||||
}
|
boost::filesystem::is_regular_file(path_iterator->second) ||
|
||||||
paths["fileindex"] = std::string( paths["base"].c_str()) + ".fileIndex";
|
!option_variables.count("base")
|
||||||
|
) {
|
||||||
|
throw OSRMException("fileindex (or base) must be specified");
|
||||||
}
|
}
|
||||||
|
paths["fileindex"] = std::string( paths["base"].string()) + ".fileIndex";
|
||||||
|
|
||||||
if(!option_variables.count("namesdata")) {
|
path_iterator = paths.find("namesdata");
|
||||||
if(!option_variables.count("base")) {
|
if(
|
||||||
throw OSRMException("namesdata (or base) must be specified");
|
path_iterator == paths.end() ||
|
||||||
}
|
boost::filesystem::is_regular_file(path_iterator->second) ||
|
||||||
paths["namesdata"] = std::string( paths["base"].c_str()) + ".names";
|
!option_variables.count("base")
|
||||||
|
) {
|
||||||
|
throw OSRMException("namesdata (or base) must be specified");
|
||||||
}
|
}
|
||||||
|
paths["namesdata"] = std::string( paths["base"].string()) + ".names";
|
||||||
|
|
||||||
if(!option_variables.count("timestamp")) {
|
path_iterator = paths.find("timestamp");
|
||||||
if(!option_variables.count("base")) {
|
if(
|
||||||
throw OSRMException("timestamp (or base) must be specified");
|
path_iterator == paths.end() ||
|
||||||
}
|
boost::filesystem::is_regular_file(path_iterator->second) ||
|
||||||
paths["timestamp"] = std::string( paths["base"].c_str()) + ".timestamp";
|
!option_variables.count("base")
|
||||||
|
) {
|
||||||
|
throw OSRMException("timestamp (or base) must be specified");
|
||||||
}
|
}
|
||||||
|
paths["timestamp"] = (paths["base"].string() + ".timestamp");
|
||||||
|
|
||||||
}
|
}
|
||||||
if(1 > requested_num_threads) {
|
if(1 > requested_num_threads) {
|
||||||
throw OSRMException("Number of threads must be a positive number");
|
throw OSRMException("Number of threads must be a positive number");
|
||||||
|
Loading…
Reference in New Issue
Block a user