If you were so wise to keep your code compiler independant: compile it with FPC, and use -gh, at program exit, all memory leaks will be printed, along with their locations in source code.