In low Earth orbit (LEO), the large-scale and long-term orbital spacecraft is likely to be impacted by micrometeoroids and orbital debris (MMOD), which will lead to gas leakage and then seriously threaten the safety of spacecraft and astronauts. However, it is still a challenge task to locate the leakage source, due to the randomness, multiband and dispersion of the leakage signal. Targeting sensing the gas leakage in time and accurate localization of the leakage source, an improved beamforming algorithm is proposed, and used to locate the leakage source of 1 mm, 2 mm and 3 mm diameter holes respectively. The improved algorithm uses a narrowband filter with automatic frequency window to select the best frequency band, as well as to delay overlay different signal speeds with various frequency bands via a dispersion curve. Experimental results show that the improved algorithm can accurately locate the artificial leak sources with different diameters.