analyzing the following file with --std-posix report false error on the return statement. Seems like cppcheck fails detecting that mmap failed and no memory was allocated in this case include <sys mman.h=""></sys> uint8_t mmap_mem_leak_error() { void data = mmap(NULL, 10, PROT_READ, MAP_PRIVATE, 1, 0); if (data != MAP_FAILED) return data; return NULL; }
ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD not detected