In order to reduce the influence of the elasticity of components of a vessel (10, 20, 30, 40, 50) and/or of an outgassing of a liquid fluid (11), which is disposed in the vessel (10, 20, 30, 40, 50) or a condensation of a gas disposed in the vessel or of a gas mixture (12) on an underpressure or an overpressure in the vessel, a gas mass flow is controlled to obtain a constant underpressure or overpressure in the vessel. In this way, a leak of the vessel can be detected with great reliability and the size of the leak can be computed with great accuracy. The vessel is especially a vessel of a tank system and tank-venting system of a motor vehicle having an internal combustion engine. In the event that a gas mass flow adjusts, which is constant in average, and which is greater than a pregivable limit value, a conclusion is drawn as to the presence of a leak. The size of the leak is computed from a signal characterizing the constant gas mass flow.