close() statement is missing
Don't blame me about gotos.