|
Cppcheck
|
detect simple memory leaks for struct members More...
#include <checkmemoryleak.h>
Public Member Functions | |
| CheckMemoryLeakStructMember () | |
| CheckMemoryLeakStructMember (const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) | |
| void | runSimplifiedChecks (const Tokenizer *tokenizr, const Settings *settings, ErrorLogger *errLog) |
| run checks, the token list is simplified | |
| void | check () |
Private Member Functions | |
| void | checkStructVariable (const Variable *const variable) |
| void | getErrorMessages (ErrorLogger *, const Settings *) const |
| get error messages | |
| std::string | classInfo () const |
| get information about this class, used to generate documentation | |
Static Private Member Functions | |
| static bool | isMalloc (const Variable *variable) |
| Is local variable allocated with malloc? | |
| static std::string | myName () |
detect simple memory leaks for struct members
Definition at line 398 of file checkmemoryleak.h.
Definition at line 400 of file checkmemoryleak.h.
| CheckMemoryLeakStructMember::CheckMemoryLeakStructMember | ( | const Tokenizer * | tokenizr, |
| const Settings * | settings, | ||
| ErrorLogger * | errLog | ||
| ) | [inline] |
Definition at line 403 of file checkmemoryleak.h.
| void CheckMemoryLeakStructMember::check | ( | ) |
Definition at line 2537 of file checkmemoryleak.cpp.
References Check::_tokenizer, checkStructVariable(), Tokenizer::getSymbolDatabase(), SymbolDatabase::getVariableFromVarId(), SymbolDatabase::getVariableListSize(), Variable::isLocal(), Token::isStandardType(), Variable::isStatic(), and Variable::typeEndToken().
Referenced by runSimplifiedChecks().
| void CheckMemoryLeakStructMember::checkStructVariable | ( | const Variable *const | variable | ) | [private] |
Definition at line 2565 of file checkmemoryleak.cpp.
References Check::_tokenizer, Scope::classEnd, Tokenizer::isC(), isMalloc(), Variable::isPointer(), Token::linkAt(), CheckMemoryLeak::Malloc, Token::Match(), CheckMemoryLeak::memoryLeak(), Variable::name(), Variable::nameToken(), Token::next(), Variable::scope(), Token::simpleMatch(), and Variable::varId().
Referenced by check().
| std::string CheckMemoryLeakStructMember::classInfo | ( | ) | const [inline, private, virtual] |
get information about this class, used to generate documentation
Implements Check.
Definition at line 428 of file checkmemoryleak.h.
| void CheckMemoryLeakStructMember::getErrorMessages | ( | ErrorLogger * | errorLogger, |
| const Settings * | settings | ||
| ) | const [inline, private, virtual] |
| bool CheckMemoryLeakStructMember::isMalloc | ( | const Variable * | variable | ) | [static, private] |
Is local variable allocated with malloc?
Definition at line 2550 of file checkmemoryleak.cpp.
References Scope::classEnd, Token::Match(), Variable::nameToken(), Token::next(), Variable::scope(), and Variable::varId().
Referenced by checkStructVariable().
| static std::string CheckMemoryLeakStructMember::myName | ( | ) | [inline, static, private] |
Definition at line 424 of file checkmemoryleak.h.
| void CheckMemoryLeakStructMember::runSimplifiedChecks | ( | const Tokenizer * | tokenizer, |
| const Settings * | settings, | ||
| ErrorLogger * | errorLogger | ||
| ) | [inline, virtual] |
run checks, the token list is simplified
Implements Check.
Definition at line 407 of file checkmemoryleak.h.
References check().
1.7.6.1