Fix static analysis errors

Hey, you guys should run the static analyzer :) I fixed the two issues that it flagged. The leak was actually important; the other one was just a coding standard flag, but it seemed worthwhile to fix.