From f49cc7f0ff4021244543780388f496e1a8fa5e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 18 Jan 2010 21:58:27 +0100 Subject: [PATCH] CheckMemoryLeak: Added 'scanf' and 'sscanf' to the whitelist --- lib/checkmemoryleak.cpp | 4 ++-- test/testmemleak.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/checkmemoryleak.cpp b/lib/checkmemoryleak.cpp index f9985f2a8..4bc3bc799 100644 --- a/lib/checkmemoryleak.cpp +++ b/lib/checkmemoryleak.cpp @@ -49,8 +49,8 @@ static const char * const call_func_white_list[] = , "fwrite", "getc", "if", "ioctl", "lockf", "lseek", "memchr", "memcpy" , "memmove", "memset", "posix_fadvise", "posix_fallocate", "pread" , "printf", "puts", "pwrite", "qsort", "read", "readahead", "readdir", "readdir_r", "readv" - , "realloc", "return", "rewind", "rewinddir", "scandir", "seekdir" - , "setbuf", "setbuffer", "setlinebuf", "setvbuf", "snprintf", "sprintf", "strcasecmp" + , "realloc", "return", "rewind", "rewinddir", "scandir", "scanf", "seekdir" + , "setbuf", "setbuffer", "setlinebuf", "setvbuf", "snprintf", "sprintf", "sscanf", "strcasecmp" , "strcat", "strchr", "strcmp", "strcpy", "stricmp", "strlen", "strncat", "strncmp" , "strncpy", "strrchr", "strstr", "strtod", "strtol", "strtoul", "switch" , "sync_file_range", "telldir", "typeid", "while", "write", "writev" diff --git a/test/testmemleak.cpp b/test/testmemleak.cpp index c7ca840e6..e660c15d0 100644 --- a/test/testmemleak.cpp +++ b/test/testmemleak.cpp @@ -510,6 +510,8 @@ private: { // whitelist.. ASSERT_EQUALS(true, CheckMemoryLeakInFunction::test_white_list("qsort")); + ASSERT_EQUALS(true, CheckMemoryLeakInFunction::test_white_list("scanf")); + ASSERT_EQUALS(true, CheckMemoryLeakInFunction::test_white_list("sscanf")); static const char * const call_func_white_list[] = {