There are a couple of tools that track down code which is problematic with regard to memory corruption or similar, both at compile time, and at run time. I am using a commercial one which is quite good, but I've found it slows down both compilation and run time behaviour by an order of magnitude at least.
There are a few articles on this topic as well, try out any of these links:
Memory Leak detection in .NET
Windows Memory leak detection
Visual Leak Detector