Applied patch 0003-GetAllocationType-mark-some-members-as-static-and-a.patch
Author: php-coder Ticket: http://apps.sourceforge.net/trac/cppcheck/ticket/321
This commit is contained in:
parent
eafb1f823c
commit
47e10b75e3
|
@ -70,15 +70,15 @@ CheckMemoryLeakClass::AllocType CheckMemoryLeakClass::GetAllocationType(const To
|
||||||
return No;
|
return No;
|
||||||
|
|
||||||
// Does tok2 point on "malloc", "strdup" or "kmalloc"..
|
// Does tok2 point on "malloc", "strdup" or "kmalloc"..
|
||||||
const char *mallocfunc[] = {"malloc",
|
static const char * const mallocfunc[] = {"malloc",
|
||||||
"calloc",
|
"calloc",
|
||||||
"strdup",
|
"strdup",
|
||||||
"strndup",
|
"strndup",
|
||||||
"kmalloc",
|
"kmalloc",
|
||||||
"kzalloc",
|
"kzalloc",
|
||||||
"kcalloc",
|
"kcalloc",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
for (unsigned int i = 0; mallocfunc[i]; i++)
|
for (unsigned int i = 0; mallocfunc[i]; i++)
|
||||||
{
|
{
|
||||||
if (tok2->str() == mallocfunc[i])
|
if (tok2->str() == mallocfunc[i])
|
||||||
|
@ -86,18 +86,18 @@ CheckMemoryLeakClass::AllocType CheckMemoryLeakClass::GetAllocationType(const To
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does tok2 point on "g_malloc", "g_strdup", ..
|
// Does tok2 point on "g_malloc", "g_strdup", ..
|
||||||
const char *gmallocfunc[] = {"g_new",
|
static const char * const gmallocfunc[] = {"g_new",
|
||||||
"g_new0",
|
"g_new0",
|
||||||
"g_try_new",
|
"g_try_new",
|
||||||
"g_try_new0",
|
"g_try_new0",
|
||||||
"g_malloc",
|
"g_malloc",
|
||||||
"g_malloc0",
|
"g_malloc0",
|
||||||
"g_try_malloc",
|
"g_try_malloc",
|
||||||
"g_try_malloc0",
|
"g_try_malloc0",
|
||||||
"g_strdup",
|
"g_strdup",
|
||||||
"g_strndup",
|
"g_strndup",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
for (unsigned int i = 0; gmallocfunc[i]; i++)
|
for (unsigned int i = 0; gmallocfunc[i]; i++)
|
||||||
{
|
{
|
||||||
if (tok2->str() == gmallocfunc[i])
|
if (tok2->str() == gmallocfunc[i])
|
||||||
|
|
Loading…
Reference in New Issue