Skip to content

Commit 4e595f4

Browse files
Update checkleakautovar.cpp [skip ci]
1 parent 2bd7e6f commit 4e595f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/checkleakautovar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ bool CheckLeakAutoVarImpl::checkScope(const Token * const startToken,
342342
}
343343
}
344344

345-
if (tok->str() == "}" && tok == tok->scope()->bodyEnd && tok->scope()->type == ScopeType::eUnconditional)
346-
ret(tok, varInfo);
345+
if (tok == tok->scope()->bodyEnd && tok->scope()->type == ScopeType::eUnconditional)
346+
ret(tok, varInfo, /*isEndOfScope*/ true);
347347

348348
// look for end of statement
349349
const bool isInit = Token::Match(tok->tokAt(-1), "%var% {|(") && tok->tokAt(-1)->variable() && tok->tokAt(-1) == tok->tokAt(-1)->variable()->nameToken();

0 commit comments

Comments
 (0)