Prevent invalid memory access under failure conditions