memory leaks: fixed false positive for struct members - better handling of if/else
This commit is contained in:
parent
73c028bdb7
commit
6bb85703f6
|
@ -2029,7 +2029,7 @@ void CheckMemoryLeakStructMember::check()
|
|||
}
|
||||
|
||||
// Deallocating the struct..
|
||||
else if (Token::Match(tok3, "free|kfree ( %varid% )", structid))
|
||||
else if (indentlevel2 == 0 && Token::Match(tok3, "free|kfree ( %varid% )", structid))
|
||||
{
|
||||
memoryLeak(tok3, (vartok->str() + "." + tok2->strAt(2)).c_str(), Malloc, false);
|
||||
break;
|
||||
|
|
|
@ -2995,7 +2995,7 @@ private:
|
|||
" free(abc->a);\n"
|
||||
" free(abc);\n"
|
||||
"}\n");
|
||||
TODO_ASSERT_EQUALS("", errout.str());
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue