src/checkmemoryleak.cpp: added fchmod() function to white list.
This commit is contained in:
parent
d3490abd64
commit
2ba0897ecb
|
@ -435,7 +435,7 @@ const char * CheckMemoryLeakInFunction::call_func(const Token *tok, std::list<co
|
||||||
|
|
||||||
// I/O functions that are not allocating nor deallocating memory..
|
// I/O functions that are not allocating nor deallocating memory..
|
||||||
if (Token::Match(tok, "read|readv|pread|readahead|write|writev|pwrite|lseek") ||
|
if (Token::Match(tok, "read|readv|pread|readahead|write|writev|pwrite|lseek") ||
|
||||||
Token::Match(tok, "ioctl|fcntl|flock|lockf|ftruncate|fsync|fdatasync") ||
|
Token::Match(tok, "ioctl|fchmod|fcntl|flock|lockf|ftruncate|fsync|fdatasync") ||
|
||||||
Token::Match(tok, "fstat|sync_file_range|posix_fallocate|posix_fadvise"))
|
Token::Match(tok, "fstat|sync_file_range|posix_fallocate|posix_fadvise"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -2316,8 +2316,9 @@ private:
|
||||||
" lockf(fd, cmd, len);\n"
|
" lockf(fd, cmd, len);\n"
|
||||||
" ftruncate(fd, len);\n"
|
" ftruncate(fd, len);\n"
|
||||||
" fstat(fd, buf);\n"
|
" fstat(fd, buf);\n"
|
||||||
|
" fchmod(fd, mode);\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("[test.cpp:23]: (error) Resource leak: fd\n", errout.str());
|
ASSERT_EQUALS("[test.cpp:24]: (error) Resource leak: fd\n", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void opendir_function()
|
void opendir_function()
|
||||||
|
|
Loading…
Reference in New Issue