An agreement to indemnify a person against an act thereafter to be done is void if the act be known by such person at the time of doing it to be unlawful.
R.L.1910, § 1075.