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

Method isReopenStandardStream

lib/checkmemoryleak.cpp:242–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242bool CheckMemoryLeakImpl::isReopenStandardStream(const Token *tok) const
243{
244 if (getReallocationType(tok, 0) == File) {
245 const Library::AllocFunc *f = mSettings.library.getReallocFuncInfo(tok);
246 if (f && f->reallocArg > 0 && f->reallocArg <= numberOfArguments(tok)) {
247 const Token* arg = getArguments(tok).at(f->reallocArg - 1);
248 if (Token::Match(arg, "stdin|stdout|stderr"))
249 return true;
250 }
251 }
252 return false;
253}
254
255bool CheckMemoryLeakImpl::isOpenDevNull(const Token *tok) const
256{

Callers

nothing calls this directly

Calls 4

numberOfArgumentsFunction · 0.85
getReallocFuncInfoMethod · 0.80
atMethod · 0.80
getArgumentsFunction · 0.70

Tested by

no test coverage detected