Fix several memory leaks.

2 files changed