I sometimes wondered about the possibility of patching the OS so it keeps track of who reserved the memory. Problem is programs sometimes send each other data as pointers so the program that reserved the memory isn't necessarily the one using it when it exits. So freeing it automatically could cause unexpected things to happen. But it could be used for diagnostic purposes or allow you to free blocks manually or somesuch.
Maybe this already exists on Aminet, I haven't looked.