MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / isPointerReleased

Function isPointerReleased

lib/checkleakautovar.cpp:207–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207static bool isPointerReleased(const Token *startToken, const Token *endToken, nonneg int varid)
208{
209 for (const Token *tok = startToken; tok && tok != endToken; tok = tok->next()) {
210 if (tok->varId() != varid)
211 continue;
212 if (Token::Match(tok, "%var% . release ( )"))
213 return true;
214 if (Token::Match(tok, "%var% ="))
215 return false;
216 }
217 return false;
218}
219
220static bool isLocalVarNoAutoDealloc(const Token *varTok)
221{

Callers 1

checkScopeMethod · 0.85

Calls 1

nextMethod · 0.80

Tested by

no test coverage detected