Dolby Interview Question

How would you prevent a memory leak?