Why it's treated as error? (Cppcheck 1.74)
#include "DDK_Context.h" typedef struct { FILE* fp; DDK* pDDK; } MEMORY_DUMP; BOOL DDKContext::LoadMemoryDump(const char* sFileName) { MEMORY_DUMP dump; dump.pDDK = this; if((dump.fp = fopen(sFileName, "rb"))) { printf("opened...\n"); fclose(dump.fp); return TRUE; } return FALSE; }
C:\Program Files (x86)\Cppcheck>cppcheck.exe DDK_MemoryDump.cpp Checking DDK_MemoryDump.cpp... [DDK_MemoryDump.cpp:26]: (error) Memory leak: dump.fp
Old 1.67 version is ok, but not in this recent version.
I have created a ticket about this issue here
Log in to post a comment.
Why it's treated as error? (Cppcheck 1.74)
C:\Program Files (x86)\Cppcheck>cppcheck.exe DDK_MemoryDump.cpp
Checking DDK_MemoryDump.cpp...
[DDK_MemoryDump.cpp:26]: (error) Memory leak: dump.fp
Old 1.67 version is ok, but not in this recent version.
I have created a ticket about this issue here