| 641 | } |
| 642 | |
| 643 | void CheckMemoryLeakInClassImpl::unsafeClassError(const Token *tok, const std::string &classname, const std::string &varname) |
| 644 | { |
| 645 | if (!mSettings.severity.isEnabled(Severity::style) && !mSettings.isPremiumEnabled("unsafeClassCanLeak")) |
| 646 | return; |
| 647 | |
| 648 | reportError(tok, Severity::style, "unsafeClassCanLeak", |
| 649 | "$symbol:" + classname + "\n" |
| 650 | "$symbol:" + varname + "\n" |
| 651 | "Class '" + classname + "' is unsafe, '" + varname + "' can leak by wrong usage.\n" |
| 652 | "The class '" + classname + "' is unsafe, wrong usage can cause memory/resource leaks for '" + varname + "'. This can for instance be fixed by adding proper cleanup in the destructor.", CWE398, Certainty::normal); |
| 653 | } |
| 654 | |
| 655 | |
| 656 | void CheckMemoryLeakInClassImpl::checkPublicFunctions(const Scope *scope, const Token *classtok) |
no test coverage detected