More static analysis fixes
This commit is contained in:
parent
cafd868773
commit
0da3390d09
14 changed files with 40 additions and 33 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue