Fix a memory leak in the example.