fix a potential memleak in cs_open() - happened when arch is invalid/unsupported