Menu

Latest version 2.10 is not detecting memory leak

Yash Anand
2023-04-06
2023-04-06
  • Yash Anand

    Yash Anand - 2023-04-06

    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>
    using namespace std;
    
    void func()
    {
        cout << "Entering the function" << endl;
    }
    
    int main()
    {
        int *p = new int(2);
        func();
    
    }
    
     
  • CHR

    CHR - 2023-04-06

    Thanks for reporting, this should be fixed in head by now.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.