Which way do u go to infinity ?
I mean going to infinity at perpendicular direction to the line charge & not along the line .
In the other case there is something in advanced math called dirac's delta fn . With its help potential can be defined all over the space also ( Of course with an arbitrary const . )