facebook/infer

Infer cannot report memory leak caused by new?

Closed this issue · 0 comments

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?