Generally if you create a public hazard (e.g. a slippery floor, a porch with a rotten floor that someone falls through) you'll be liable if someone gets injured. That's why you need to enclose and lock your pool.