Generally speaking, all batteries will leak over time. However, certain factors can speed up the process. Heat is the biggest culprit. Storing your flashlights under the seat of your car, or in direct sunlight will cause the batteries to leak. The reason they leak is because they are filled with a chemical paste of which the liquid portion is composed of a base called Potassium Hydroxide. When the batteries get hot, the paste inside expands, and forces chemicals out of the seals in the bottom and top of the battery. When the Potassium Hydroxide makes contact with the spring and terminal in your flashlight, it produces a blue-green powder as it corrodes the terminals away. Cleaning up this powder is easy. The best method I have found is Vinegar. Since the powder is a base, using a little Vinegar (Acetic Acid) will neutralize it quickly and make cleanup a lot simpler.
The best way to avoid future leaks is to keep the flashlight in a relatively cool area. Also, avoid really cheap no-name batteries. You don't have to pay for the high-dollar Energizers or anything like that, but avoid things like "Super Cell" or "Power Max", obvious knock-offs that are half the price of the other no-name batteries. Also, don't mix battery types. There are Standard batteries, and Alkaline batteries. If you mix standard with alkaline, two things can happen. The alkaline batteries are slightly more powerful, and will cause the regular batteries to heat up more in operation, causing them to leak faster. Also, the regular batteries will drag down the alkalines, causing them to die faster.
Regardless of the brand you buy, as I said above, all batteries will leak eventually, so if you don't use the flashlight for extended periods of 3 months or more, remove the batteries, or change them out every couple months.
I'm a battery specialist