Fixed false positive #6466
This commit is contained in:
parent
0c89afcc48
commit
9ada111045
|
@ -412,7 +412,7 @@ void CheckLeakAutoVar::checkScope(const Token * const startToken,
|
|||
tok = tok->next();
|
||||
while (Token::Match(tok, "%var% ::|."))
|
||||
tok = tok->tokAt(2);
|
||||
if (tok->varId()) {
|
||||
if (tok->varId() && tok->strAt(1) != "[") {
|
||||
VarInfo::AllocInfo allocation(-1, VarInfo::DEALLOC);
|
||||
changeAllocStatus(varInfo, allocation, tok, tok);
|
||||
}
|
||||
|
|
|
@ -473,6 +473,13 @@ private:
|
|||
"}", true);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check(
|
||||
"void foo(char **p) {\n"
|
||||
" delete p[0];\n"
|
||||
" delete p[1];\n"
|
||||
"}", true);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check(
|
||||
"void foo(char *p) {\n"
|
||||
" delete p;\n"
|
||||
|
|
Loading…
Reference in New Issue