diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index 619f23300..4eba45ab2 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -385,7 +385,7 @@ void CheckMemoryLeak::deallocuseError(const Token *tok, const std::string &varna void CheckMemoryLeak::mismatchSizeError(const Token *tok, const std::string &sz) const { - reportErr(tok, Severity::error, "mismatchSize", "The given size " + sz + " is mismatching"); + reportErr(tok, Severity::error, "mismatchSize", "The allocated size " + sz + " is not a multiple of the underlying type's size."); } void CheckMemoryLeak::mismatchAllocDealloc(const std::list &callstack, const std::string &varname) const diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index 541ce038c..21802140c 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -3490,13 +3490,14 @@ private: " int *p = malloc(3);\n" " free(p);\n" "}\n"); - ASSERT_EQUALS("[test.cpp:3]: (error) The given size 3 is mismatching\n", errout.str()); + ASSERT_EQUALS("[test.cpp:3]: (error) The allocated size 3 is not a multiple of the underlying type's size.\n", errout.str()); + check("void foo()\n" "{\n" " int *p = g_malloc(3);\n" " g_free(p);\n" "}\n"); - TODO_ASSERT_EQUALS("[test.cpp:3]: (error) The given size 3 is mismatching\n", "", errout.str()); + TODO_ASSERT_EQUALS("[test.cpp:3]: (error) The allocated size 3 is not a multiple of the underlying type's size.\n", "", errout.str()); }