Since this seems to be some sort of joke i'm going to provide a "real" answer: write modular software where you can verify that each module is leak proof + use valgrind to actually track and verify you don't have links.
I have written medium to large projects using this approach and a leak-free program is not outside the realm of possible