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

Method isOpenDevNull

lib/checkmemoryleak.cpp:255–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255bool CheckMemoryLeakImpl::isOpenDevNull(const Token *tok) const
256{
257 if (mSettings.hasLib("posix") && tok->str() == "open" && numberOfArguments(tok) == 2) {
258 const Token* arg = getArguments(tok).at(0);
259 if (Token::simpleMatch(arg, "\"/dev/null\""))
260 return true;
261 }
262 return false;
263}
264
265void CheckMemoryLeakImpl::memoryLeak(const Token *tok, const std::string &varname, AllocType alloctype) const
266{

Callers

nothing calls this directly

Calls 5

numberOfArgumentsFunction · 0.85
atMethod · 0.80
getArgumentsFunction · 0.70
simpleMatchFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected