extended checkmemoryleak-whitelist

This commit is contained in:
Ettl Martin 2011-03-22 22:13:29 +01:00
parent f89f0c748f
commit ff1de4c896
2 changed files with 29 additions and 16 deletions

View File

@ -47,25 +47,32 @@ CheckMemoryLeakNoVar instance4;
// Reference: http://www.aquaphoenix.com/ref/gnu_c_library/libc_492.html#SEC492
static const char * const call_func_white_list[] =
{
"_open", "_wopen", "access", "asctime", "asctime_r", "asprintf", "assert"
"_open", "_wopen", "access", "adjtime", "asctime", "asctime_r", "asprintf", "assert"
, "atof", "atoi", "atol", "chdir", "chmod", "chown"
, "clearerr", "ctime", "ctime_r", "delete", "fchmod", "fclose", "fcntl"
, "fdatasync", "feof", "ferror", "fflush", "fgetc", "fgetpos", "fgets"
, "flock", "for", "fprintf", "fputc", "fputs", "fread", "free", "freopen", "fscanf", "fseek"
, "fseeko", "fsetpos", "fstat", "fsync", "ftell", "ftello", "ftruncate"
, "fwrite", "getc", "gets", "gmtime", "gmtime_r", "if", "ioctl"
, "localtime", "localtime_r"
, "lockf", "lseek", "lstat", "memchr", "memcmp", "memcpy", "memmove", "memset", "open"
, "perror", "posix_fadvise", "posix_fallocate", "pread"
, "printf", "puts", "pwrite", "qsort", "read", "readahead", "readdir", "readdir_r", "readv"
, "realloc", "remove", "rename", "return", "rewind", "rewinddir", "rindex" ,"rmdir" ,"scandir", "scanf", "seekdir"
, "clearerr", "creat", "ctime", "ctime_r", "delete", "execl", "execle"
, "execlp", "execv", "execve", "fchmod", "fclose", "fcntl"
, "fdatasync", "fdopen", "feof", "ferror", "fflush", "fgetc", "fgetpos", "fgets"
, "flock", "fmemopen", "fnmatch", "fopen", "fopencookie", "for", "fprintf", "fputc", "fputs", "fread", "free"
, "freopen", "fscanf", "fseek", "fseeko", "fsetpos", "fstat", "fsync", "ftell", "ftello"
, "ftruncate", "fwrite", "getc", "getenv","getgrnam", "gethostbyaddr", "gethostbyname", "getnetbyname"
, "getopt", "getopt_long", "getprotobyname", "getpwnam", "gets", "getservbyname", "getservbyport"
, "glob", "gmtime", "gmtime_r", "if", "index", "inet_addr", "inet_aton", "inet_network", "initgroups", "ioctl"
, "link", "localtime", "localtime_r"
, "lockf", "lseek", "lstat", "mblen", "mbstowcs", "mbtowc", "memchr", "memcmp", "memcpy", "memmove", "memset"
, "mkdir", "mkfifo", "mknod"
, "obstack_printf", "obstack_vprintf", "open", "opendir", "parse_printf_format", "pathconf"
, "perror", "popen" ,"posix_fadvise", "posix_fallocate", "pread"
, "printf", "psignal", "putenv", "puts", "pwrite", "qsort", "read", "readahead", "readdir", "readdir_r"
, "readlink", "readv"
, "realloc", "regcomp", "remove", "rename", "return", "rewind", "rewinddir", "rindex"
, "rmdir" ,"scandir", "scanf", "seekdir"
, "setbuf", "setbuffer", "sethostname", "setlinebuf", "setlocale" ,"setvbuf", "snprintf", "sprintf", "sscanf"
, "stat", "stpcpy", "strcasecmp", "strcat", "strchr", "strcmp", "strcoll"
, "strcpy", "strcspn", "strdup", "stricmp", "strlen", "strncasecmp", "strncat", "strncmp"
, "strncpy", "strpbrk","strrchr", "strspn", "strstr", "strtod", "strtol", "strtoul", "switch"
, "symlink", "sync_file_range", "system", "telldir", "tempnam","time", "typeid", "unlink"
, "utime", "utimes" ,"vasprintf", "vfprintf", "vfscanf", "vprintf"
, "vscanf", "vsnprintf", "vsprintf", "vsscanf", "while", "write", "writev"
, "strncpy", "strpbrk","strrchr", "strspn", "strstr", "strtod", "strtol", "strtoul", "strxfrm", "switch"
, "symlink", "sync_file_range", "system", "telldir", "tempnam", "time", "typeid", "unlink"
, "utime", "utimes", "vasprintf", "vfprintf", "vfscanf", "vprintf"
, "vscanf", "vsnprintf", "vsprintf", "vsscanf", "while", "wordexp","write", "writev"
};
static int call_func_white_list_compare(const void *a, const void *b)

View File

@ -581,7 +581,13 @@ private:
, "sync_file_range", "telldir", "typeid", "while", "write", "writev", "lstat", "stat"
, "_open", "_wopen", "vscanf", "vsscanf", "vfscanf", "vasprintf", "utime", "utimes", "unlink"
, "tempnam", "system", "symlink", "strpbrk", "strncasecmp", "strdup", "strcspn", "strcoll"
, "setlocale", "sethostname", "rmdir", "rindex", "rename", "remove"
, "setlocale", "sethostname", "rmdir", "rindex", "rename", "remove", "adjtime", "creat", "execle"
, "execl", "execlp", "execve", "execv", "fdopen", "fmemopen", "fnmatch", "fopencookie", "fopen"
, "getgrnam", "gethostbyaddr", "getnetbyname", "getopt", "getopt_long", "getprotobyname", "getpwnam"
, "getservbyname", "getservbyport", "glob", "index", "inet_addr", "inet_aton", "inet_network"
, "initgroups", "link", "mblen", "mbstowcs", "mbtowc", "mkdir", "mkfifo", "mknod", "obstack_printf"
, "obstack_vprintf", "opendir", "parse_printf_format", "pathconf", "popen", "psignal", "putenv"
, "readlink", "regcomp", "strxfrm", "wordexp"
};
for (unsigned int i = 0; i < (sizeof(call_func_white_list) / sizeof(char *)); ++i)