Memory leaks: Added allocation function 'g_strdup_printf'
This commit is contained in:
parent
68ad8219ed
commit
a9196e8710
|
@ -130,6 +130,7 @@ CheckMemoryLeak::AllocType CheckMemoryLeak::getAllocationType(const Token *tok2,
|
||||||
"g_try_malloc0",
|
"g_try_malloc0",
|
||||||
"g_strdup",
|
"g_strdup",
|
||||||
"g_strndup",
|
"g_strndup",
|
||||||
|
"g_strdup_printf",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
for (unsigned int i = 0; gmallocfunc[i]; i++)
|
for (unsigned int i = 0; gmallocfunc[i]; i++)
|
||||||
|
|
|
@ -427,6 +427,7 @@ private:
|
||||||
ASSERT_EQUALS(";;alloc;", getcode("int *a = new int[10];", "a"));
|
ASSERT_EQUALS(";;alloc;", getcode("int *a = new int[10];", "a"));
|
||||||
ASSERT_EQUALS(";;alloc;", getcode("int * const a = new int[10];", "a"));
|
ASSERT_EQUALS(";;alloc;", getcode("int * const a = new int[10];", "a"));
|
||||||
ASSERT_EQUALS(";;alloc;", getcode("const int * const a = new int[10];", "a"));
|
ASSERT_EQUALS(";;alloc;", getcode("const int * const a = new int[10];", "a"));
|
||||||
|
ASSERT_EQUALS(";;alloc;", getcode("char *a = g_strdup_printf(\"ab\");", "a"));
|
||||||
|
|
||||||
// alloc; return use;
|
// alloc; return use;
|
||||||
ASSERT_EQUALS(";;alloc;returnuse;", getcode("int *a = new int[10]; return a;", "a"));
|
ASSERT_EQUALS(";;alloc;returnuse;", getcode("int *a = new int[10]; return a;", "a"));
|
||||||
|
|
Loading…
Reference in New Issue