don't call fclose() on a NULL file handle.