Updated memory leaks example