| 150 | } |
| 151 | |
| 152 | void CheckLeakAutoVarImpl::doubleFreeError(const Token *tok, const Token *prevFreeTok, const std::string &varname, int type) |
| 153 | { |
| 154 | const std::list<const Token *> locations = { prevFreeTok, tok }; |
| 155 | |
| 156 | if (Library::isresource(type)) |
| 157 | reportError(locations, Severity::error, "doubleFree", "$symbol:" + varname + "\nResource handle '$symbol' freed twice.", CWE415, Certainty::normal); |
| 158 | else |
| 159 | reportError(locations, Severity::error, "doubleFree", "$symbol:" + varname + "\nMemory pointed to by '$symbol' is freed twice.", CWE415, Certainty::normal); |
| 160 | } |
| 161 | |
| 162 | |
| 163 | void CheckLeakAutoVarImpl::check() |
no test coverage detected