I tried to call the function after allocation of memory with pointers but it seems that the memory leak is
not detected. It was fixed 4 years ago in the below post but in the latest version the defect seems to persist. https://trac.cppcheck.net/ticket/9279#no1
I have attached the working sample code and the screenshot of GUI where the warning details are
mentioned.
C++ code :
#include<bits/stdc++.h>usingnamespacestd;voidfunc(){cout<<"Entering the function"<<endl;}intmain(){int*p=newint(2);func();}
I tried to call the function after allocation of memory with pointers but it seems that the memory leak is
not detected. It was fixed 4 years ago in the below post but in the latest version the defect seems to persist.
https://trac.cppcheck.net/ticket/9279#no1
I have attached the working sample code and the screenshot of GUI where the warning details are
mentioned.
C++ code :
Thanks for reporting, this should be fixed in head by now.