Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer cannot report memory leak caused by new? #1839

Closed
u201111476 opened this issue Jun 7, 2024 · 0 comments
Closed

Infer cannot report memory leak caused by new? #1839

u201111476 opened this issue Jun 7, 2024 · 0 comments

Comments

@u201111476
Copy link

I have a cpp source file,whose contents are as below:

#include<stdio.h>
#include<stdlib.h>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
	char* buf=new char;
  *buf='c';
  cout<<buf<<endl;
  return 0;
}

then I use infer capture -- clang++ main.cpp and infer analyze --bufferoverrun --pulse,but infer does not check out the obvious memory leak caused by new,what should I do to check out this real flaw?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant