Gas anti-flow safety device