We study an eigenvalue problem with a spectral parameter in a boundary condition. This problem for the two–dimensional Laplace equation is relevant to sloshing frequencies that describe free oscillations of an inviscid, incompressible, heavy fluid in a canal having uniform cross–section and bounded from above by a horizontal free surface. It is demonstrated that there exist domains such that at least one of the eigenfunctions has a nodal line or lines with both ends on the free surface (earlier, Kuttler tried to prove that there are no such nodal lines for all domains but his proof is erroneous). It is also shown that the fundamental eigenvalue is simple, and for the corresponding eigenfunction the behaviour of the nodal line is characterized. For this purpose, a new variational principle is proposed for an equivalent statement of the sloshing problem in terms of the conjugate stream function.