astyle formatting
This commit is contained in:
parent
47ef8cf455
commit
cf75e2bb28
|
@ -2590,8 +2590,8 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable * const var
|
|||
|
||||
// Struct member is allocated => check if it is also properly deallocated..
|
||||
else if (Token::Match(tok2->previous(), "[;{}] %varid% . %var% = malloc|strdup|kmalloc (", variable->varId())
|
||||
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new ", variable->varId())
|
||||
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = fopen (", variable->varId())) {
|
||||
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = new ", variable->varId())
|
||||
|| Token::Match(tok2->previous(), "[;{}] %varid% . %var% = fopen (", variable->varId())) {
|
||||
const unsigned int structid(variable->varId());
|
||||
const unsigned int structmemberid(tok2->tokAt(2)->varId());
|
||||
|
||||
|
@ -2611,9 +2611,9 @@ void CheckMemoryLeakStructMember::checkStructVariable(const Variable * const var
|
|||
|
||||
// Deallocating the struct member..
|
||||
else if (Token::Match(tok3, "free|kfree ( %var% . %varid% )", structmemberid)
|
||||
|| Token::Match(tok3, "delete %var% . %varid%", structmemberid)
|
||||
|| Token::Match(tok3, "delete [ ] %var% . %varid%", structmemberid)
|
||||
|| Token::Match(tok3, "fclose ( %var% . %varid%", structmemberid)) {
|
||||
|| Token::Match(tok3, "delete %var% . %varid%", structmemberid)
|
||||
|| Token::Match(tok3, "delete [ ] %var% . %varid%", structmemberid)
|
||||
|| Token::Match(tok3, "fclose ( %var% . %varid%", structmemberid)) {
|
||||
// If the deallocation happens at the base level, don't check this member anymore
|
||||
if (indentlevel3 == 0)
|
||||
break;
|
||||
|
|
|
@ -5325,7 +5325,7 @@ private:
|
|||
|
||||
// Ticket #933 Leaks with struct members not detected
|
||||
void localvars() {
|
||||
// Test error case
|
||||
// Test error case
|
||||
const char code_err[] = "struct A {\n"
|
||||
" FILE* f;\n"
|
||||
" char* c;\n"
|
||||
|
|
Loading…
Reference in New Issue