Fix some memory leaks found by smatch.

3 files changed