Unverified Commit 6eefbce4 authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

address klocwork issues (#2085)

parent 6e06cded
......@@ -345,12 +345,14 @@ string file_util::tmp_filename(const string& extension)
string tmp_template =
file_util::path_join(file_util::get_temp_directory_path(), "ngraph_XXXXXX" + extension);
char* tmpname = strdup(tmp_template.c_str());
if (tmpname != nullptr)
{
// mkstemp opens the file with open() so we need to close it
close(mkstemps(tmpname, static_cast<int>(extension.size())));
// mkstemp opens the file with open() so we need to close it
close(mkstemps(tmpname, static_cast<int>(extension.size())));
rc = tmpname;
free(tmpname);
rc = tmpname;
free(tmpname);
}
#endif
return rc;
}
......
......@@ -265,8 +265,7 @@ namespace ngraph
Shape m_shape{};
void* m_data{nullptr};
Constant(const Constant&) = delete;
Constant(Constant&&) = delete;
Constant operator=(const Constant*) = delete;
Constant operator=(const Constant&) = delete;
};
class ScalarConstantLikeBase : public Constant
......
......@@ -97,7 +97,8 @@ namespace ngraph
CPUExecutor& GetCPUExecutor()
{
static CPUExecutor cpu_executor(GetNumThreadPools());
static int num_thread_pools = GetNumThreadPools();
static CPUExecutor cpu_executor(num_thread_pools < 1 ? 1 : num_thread_pools);
return cpu_executor;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment