account: Fix leak and coverity warning