Skip to content

Instantly share code, notes, and snippets.

@erenon
Created May 6, 2011 17:42
Show Gist options
  • Save erenon/959408 to your computer and use it in GitHub Desktop.
Save erenon/959408 to your computer and use it in GitHub Desktop.
find_memleak
#include <iostream>
#include <cstdlib>
#define new _NEW_WRAPPER() + new
using namespace std;
int _NEW_WRAPPER() {
cout << "hello" << endl;
return 0;
}
#include <iostream>
#include "find_memleak.h"
using namespace std;
int main()
{
int *a;
a = new int(5);
cout << *a << endl;
delete a;
bool *b;
b = new bool(5);
delete b;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment