MatchFunctionsThatReturnArg: calling Match only once.
This commit is contained in:
parent
2f7dec2fc3
commit
b30e78e14c
|
@ -313,11 +313,7 @@ void CheckMemoryLeakClass::MemoryLeak(const Token *tok, const char varname[], Al
|
||||||
|
|
||||||
bool CheckMemoryLeakClass::MatchFunctionsThatReturnArg(const Token *tok, const std::string varname)
|
bool CheckMemoryLeakClass::MatchFunctionsThatReturnArg(const Token *tok, const std::string varname)
|
||||||
{
|
{
|
||||||
return
|
return Token::Match(tok, std::string("; " + varname + " = strcat|memcpy|memmove|strcpy ( " + varname + " ,").c_str());
|
||||||
Token::Match(tok, std::string("; " + varname + " = strcat ( " + varname + " ,").c_str())
|
|
||||||
|| Token::Match(tok, std::string("; " + varname + " = memcpy ( " + varname + " ,").c_str())
|
|
||||||
|| Token::Match(tok, std::string("; " + varname + " = memmove ( " + varname + " ,").c_str())
|
|
||||||
|| Token::Match(tok, std::string("; " + varname + " = strcpy ( " + varname + " ,").c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckMemoryLeakClass::notvar(const Token *tok, const char *varnames[])
|
bool CheckMemoryLeakClass::notvar(const Token *tok, const char *varnames[])
|
||||||
|
|
Loading…
Reference in New Issue