The code you add should be:
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#ifdef _DEBUG
#ifndef DBG_NEW
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
#define new DBG_NEW
#endif
#endif // _DEBUG</crtdbg.h></stdlib.h>
Effective only in debug build.
http://msdn.microsoft.com/en-us/library/x98tx3cf(v=vs.100).aspx[
^]
There are also comments at the bottom of this link page.