Exercise 4: Introducing Valgrind (Fixed Code)