extended checkmemoryleak white list

This commit is contained in:
Ettl Martin 2011-03-21 23:59:43 +01:00
parent 38cf9f26df
commit 7e31c91a79
2 changed files with 16 additions and 10 deletions

View File

@ -42,7 +42,9 @@ CheckMemoryLeakNoVar instance4;
} }
// This list needs to be alphabetically sorted so we can run bsearch on it // This list needs to be alphabetically sorted so we can run bsearch on it.
// This list contains function names whith const parameters e.g.: atof(const char *)
// Reference: http://www.aquaphoenix.com/ref/gnu_c_library/libc_492.html#SEC492
static const char * const call_func_white_list[] = static const char * const call_func_white_list[] =
{ {
"_open", "_wopen", "access", "asctime", "asctime_r", "asprintf", "assert" "_open", "_wopen", "access", "asctime", "asctime_r", "asprintf", "assert"
@ -56,12 +58,14 @@ static const char * const call_func_white_list[] =
, "lockf", "lseek", "lstat", "memchr", "memcmp", "memcpy", "memmove", "memset", "open" , "lockf", "lseek", "lstat", "memchr", "memcmp", "memcpy", "memmove", "memset", "open"
, "perror", "posix_fadvise", "posix_fallocate", "pread" , "perror", "posix_fadvise", "posix_fallocate", "pread"
, "printf", "puts", "pwrite", "qsort", "read", "readahead", "readdir", "readdir_r", "readv" , "printf", "puts", "pwrite", "qsort", "read", "readahead", "readdir", "readdir_r", "readv"
, "realloc", "return", "rewind", "rewinddir", "scandir", "scanf", "seekdir" , "realloc", "remove", "rename", "return", "rewind", "rewinddir", "rindex" ,"rmdir" ,"scandir", "scanf", "seekdir"
, "setbuf", "setbuffer", "setlinebuf", "setvbuf", "snprintf", "sprintf", "sscanf", "stat", "strcasecmp" , "setbuf", "setbuffer", "sethostname", "setlinebuf", "setlocale" ,"setvbuf", "snprintf", "sprintf", "sscanf"
, "strcat", "strchr", "strcmp", "strcpy", "stricmp", "strlen", "strncat", "strncmp" , "stat", "stpcpy", "strcasecmp", "strcat", "strchr", "strcmp", "strcoll"
, "strncpy", "strrchr", "strstr", "strtod", "strtol", "strtoul", "switch" , "strcpy", "strcspn", "strdup", "stricmp", "strlen", "strncasecmp", "strncat", "strncmp"
, "sync_file_range", "telldir", "time", "typeid", "vfprintf", "vprintf" , "strncpy", "strpbrk","strrchr", "strspn", "strstr", "strtod", "strtol", "strtoul", "switch"
, "vsnprintf", "vsprintf", "while", "write", "writev" , "symlink", "sync_file_range", "system", "telldir", "tempnam","time", "typeid", "unlink"
, "utime", "utimes" ,"vasprintf", "vfprintf", "vfscanf", "vprintf"
, "vscanf", "vsnprintf", "vsprintf", "vsscanf", "while", "write", "writev"
}; };
static int call_func_white_list_compare(const void *a, const void *b) static int call_func_white_list_compare(const void *a, const void *b)

View File

@ -575,11 +575,13 @@ private:
, "memmove", "memset", "perror", "posix_fadvise", "posix_fallocate", "pread" , "memmove", "memset", "perror", "posix_fadvise", "posix_fallocate", "pread"
, "printf", "puts", "pwrite", "read", "readahead", "readdir", "readdir_r", "readv" , "printf", "puts", "pwrite", "read", "readahead", "readdir", "readdir_r", "readv"
, "realloc", "return", "rewind", "rewinddir", "scandir", "seekdir" , "realloc", "return", "rewind", "rewinddir", "scandir", "seekdir"
, "setbuf", "setbuffer", "setlinebuf", "setvbuf", "snprintf", "sprintf", "strcasecmp" , "setbuf", "setbuffer", "setlinebuf", "setvbuf", "snprintf", "sprintf", "stpcpy", "strcasecmp"
, "strcat", "strchr", "strcmp", "strcpy", "stricmp", "strlen", "strncat", "strncmp" , "strcat", "strchr", "strcmp", "strcpy", "stricmp", "strlen", "strncat", "strncmp"
, "strncpy", "strrchr", "strstr", "strtod", "strtol", "strtoul", "switch" , "strncpy", "strrchr", "strspn" ,"strstr", "strtod", "strtol", "strtoul", "switch"
, "sync_file_range", "telldir", "typeid", "while", "write", "writev", "lstat", "stat" , "sync_file_range", "telldir", "typeid", "while", "write", "writev", "lstat", "stat"
, "_open", "_wopen" , "_open", "_wopen", "vscanf", "vsscanf", "vfscanf", "vasprintf", "utime", "utimes", "unlink"
, "tempnam", "system", "symlink", "strpbrk", "strncasecmp", "strdup", "strcspn", "strcoll"
, "setlocale", "sethostname", "rmdir", "rindex", "rename", "remove"
}; };
for (unsigned int i = 0; i < (sizeof(call_func_white_list) / sizeof(char *)); ++i) for (unsigned int i = 0; i < (sizeof(call_func_white_list) / sizeof(char *)); ++i)