More static analysis fixes

This commit is contained in:
SChernykh 2020-12-08 16:05:58 +01:00
parent cafd868773
commit 0da3390d09
14 changed files with 40 additions and 33 deletions

View file

@ -306,7 +306,7 @@ private:
}
static std::string merge(std::string a, std::string b, uint32_t r)
static std::string merge(const std::string& a, const std::string& b, uint32_t r)
{
switch (r % 4)
{
@ -323,7 +323,7 @@ private:
}
static std::string math(std::string d, std::string a, std::string b, uint32_t r)
static std::string math(const std::string& d, const std::string& a, const std::string& b, uint32_t r)
{
switch (r % 11)
{

View file

@ -836,7 +836,13 @@ xmrig::String xmrig::OclLib::getProgramBuildLog(cl_program program, cl_device_id
return String();
}
char *log = new char[size + 1]();
char* log = nullptr;
try {
log = new char[size + 1]();
}
catch (...) {
return String();
}
if (getProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, size, log, nullptr) != CL_SUCCESS) {
delete [] log;