Filehandle leak - uncovered by Coverity
Paranoid checking - uncovered by Coverity