safer c_cleanup_code_struct