test585: Fixed NULL pointer dereference in fopen