Disclosed is a method for controlling a processor to detect leak from a measured flow of breathable gas. The method of the processor comprises determining features from the measured flow of breathable gas and analysing the features. The method further includes identifying a leak event based on the analysing. The leak event is selected from the list of: (a) the leak event being identified with a leak indicator that rules out a valve-like mouth leak, (b) the leak event being identified based on a duration defined by time elapsed between first and second occurrences, the first occurrence associated with the measure of flow falling in a breath and the second occurrence associated with the measure of flow rising in the breath.