If any jail or building adjacent thereto shall be on fire and the prisoners shall be exposed to danger by such fire, the keeper may remove such prisoners to a place of safety and there confine them so long as may be necessary to avoid such danger, and such removal and confinement shall not be deemed an escape of such prisoners.
SDCL 24-11-14