Remove superfluous ifs
The input is created unconditionally, let's not try to deal with new failing. Especially in the light that the pointer is dereferenced just three lines above.