| 2812 | } |
| 2813 | |
| 2814 | void CheckOtherImpl::invalidFreeError(const Token *tok, const std::string &allocation, bool inconclusive) |
| 2815 | { |
| 2816 | std::string alloc = allocation; |
| 2817 | if (alloc != "new") |
| 2818 | alloc += "()"; |
| 2819 | std::string deallocated = (alloc == "new") ? "deleted" : "freed"; |
| 2820 | reportError(tok, Severity::error, "invalidFree", "Mismatching address is " + deallocated + ". The address you get from " + alloc + " must be " + deallocated + " without offset.", CWE(0U), inconclusive ? Certainty::inconclusive : Certainty::normal); |
| 2821 | } |
| 2822 | |
| 2823 | |
| 2824 | //--------------------------------------------------------------------------- |
no test coverage detected