MatchFunctionsThatReturnArg: calling Match only once.

This commit is contained in:
Leandro Penz 2009-01-28 00:23:56 +00:00
parent 2f7dec2fc3
commit b30e78e14c
1 changed files with 1 additions and 5 deletions

View File

@ -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[])