Section 1. Be it enacted, &c., That it shall be lawful for any city, borough, or township of the Commonwealth of Pennsylvania to expend out of the public funds of said municipality such amount as may be necessary to secure insurance or compensation for volunteer firemen killed or injured while going to, returning from, or attending fires in said municipality or territory adjacent thereto.