static void STORE_ATTR_INFO_attr_free(STORE_ATTR_INFO *attrs,
	STORE_ATTR_TYPES code)
	{
	if (ATTR_IS_SET(attrs,code))
		{
		switch(code)
			{
		case STORE_ATTR_FRIENDLYNAME:
		case STORE_ATTR_EMAIL:
		case STORE_ATTR_FILENAME:
			STORE_ATTR_INFO_modify_cstr(attrs, code, NULL, 0);
			break;
		case STORE_ATTR_KEYID:
		case STORE_ATTR_ISSUERKEYID:
		case STORE_ATTR_SUBJECTKEYID:
		case STORE_ATTR_ISSUERSERIALHASH:
		case STORE_ATTR_CERTHASH:
			STORE_ATTR_INFO_modify_sha1str(attrs, code, NULL, 0);
			break;
		case STORE_ATTR_ISSUER:
		case STORE_ATTR_SUBJECT:
			STORE_ATTR_INFO_modify_dn(attrs, code, NULL);
			break;
		case STORE_ATTR_SERIAL:
			STORE_ATTR_INFO_modify_number(attrs, code, NULL);
			break;
		default:
			break;
			}
		}
	}
['static void STORE_ATTR_INFO_attr_free(STORE_ATTR_INFO *attrs,\n\tSTORE_ATTR_TYPES code)\n\t{\n\tif (ATTR_IS_SET(attrs,code))\n\t\t{\n\t\tswitch(code)\n\t\t\t{\n\t\tcase STORE_ATTR_FRIENDLYNAME:\n\t\tcase STORE_ATTR_EMAIL:\n\t\tcase STORE_ATTR_FILENAME:\n\t\t\tSTORE_ATTR_INFO_modify_cstr(attrs, code, NULL, 0);\n\t\t\tbreak;\n\t\tcase STORE_ATTR_KEYID:\n\t\tcase STORE_ATTR_ISSUERKEYID:\n\t\tcase STORE_ATTR_SUBJECTKEYID:\n\t\tcase STORE_ATTR_ISSUERSERIALHASH:\n\t\tcase STORE_ATTR_CERTHASH:\n\t\t\tSTORE_ATTR_INFO_modify_sha1str(attrs, code, NULL, 0);\n\t\t\tbreak;\n\t\tcase STORE_ATTR_ISSUER:\n\t\tcase STORE_ATTR_SUBJECT:\n\t\t\tSTORE_ATTR_INFO_modify_dn(attrs, code, NULL);\n\t\t\tbreak;\n\t\tcase STORE_ATTR_SERIAL:\n\t\t\tSTORE_ATTR_INFO_modify_number(attrs, code, NULL);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}', 'int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,\n\tunsigned char *sha1str, size_t sha1str_size)\n\t{\n\tif (!attrs)\n\t\t{\n\t\tSTOREerr(STORE_F_STORE_ATTR_INFO_MODIFY_SHA1STR,\n\t\t\tERR_R_PASSED_NULL_PARAMETER);\n\t\treturn 0;\n\t\t}\n\tif (ATTR_IS_SET(attrs,code))\n\t\t{\n\t\tOPENSSL_free(attrs->values[code].sha1string);\n\t\tattrs->values[code].sha1string = NULL;\n\t\tCLEAR_ATTRBIT(attrs, code);\n\t\t}\n\treturn STORE_ATTR_INFO_set_sha1str(attrs, code, sha1str, sha1str_size);\n\t}', 'int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,\n\tunsigned char *sha1str, size_t sha1str_size)\n\t{\n\tif (!attrs)\n\t\t{\n\t\tSTOREerr(STORE_F_STORE_ATTR_INFO_SET_SHA1STR,\n\t\t\tERR_R_PASSED_NULL_PARAMETER);\n\t\treturn 0;\n\t\t}\n\tif (!ATTR_IS_SET(attrs,code))\n\t\t{\n\t\tif ((attrs->values[code].sha1string =\n\t\t\t    (unsigned char *)BUF_memdup(sha1str,\n\t\t\t\t    sha1str_size)))\n\t\t\treturn 1;\n\t\tSTOREerr(STORE_F_STORE_ATTR_INFO_SET_CSTR,\n\t\t\tERR_R_MALLOC_FAILURE);\n\t\treturn 0;\n\t\t}\n\tSTOREerr(STORE_F_STORE_ATTR_INFO_SET_SHA1STR, STORE_R_ALREADY_HAS_A_VALUE);\n\treturn 0;\n\t}', 'void *BUF_memdup(const void *data, size_t siz)\n\t{\n\tvoid *ret;\n\tif (data == NULL) return(NULL);\n\tret=OPENSSL_malloc(siz);\n\tif (ret == NULL)\n\t\t{\n\t\tBUFerr(BUF_F_BUF_MEMDUP,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\treturn memcpy(ret, data, siz);\n\t}', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tvoid *ret = NULL;\n\textern unsigned char cleanse_ctr;\n\tif (num < 0) return NULL;\n\tallow_customize = 0;\n\tif (malloc_debug_func != NULL)\n\t\t{\n\t\tallow_customize_debug = 0;\n\t\tmalloc_debug_func(NULL, num, file, line, 0);\n\t\t}\n\tret = malloc_ex_func(num,file,line);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\\n", ret, num);\n#endif\n\tif (malloc_debug_func != NULL)\n\t\tmalloc_debug_func(ret, num, file, line, 1);\n        if(ret && (num > 2048))\n                ((unsigned char *)ret)[0] = cleanse_ctr;\n\treturn ret;\n\t}', 'void ERR_put_error(int lib, int func, int reason, const char *file,\n\t     int line)\n\t{\n\tERR_STATE *es;\n#ifdef _OSD_POSIX\n\tif (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {\n\t\tchar *end;\n\t\tfile += sizeof("*POSIX(")-1;\n\t\tend = &file[strlen(file)-1];\n\t\tif (*end == \')\')\n\t\t\t*end = \'\\0\';\n\t\tif ((end = strrchr(file, \'/\')) != NULL)\n\t\t\tfile = &end[1];\n\t}\n#endif\n\tes=ERR_get_state();\n\tes->top=(es->top+1)%ERR_NUM_ERRORS;\n\tif (es->top == es->bottom)\n\t\tes->bottom=(es->bottom+1)%ERR_NUM_ERRORS;\n\tes->err_buffer[es->top]=ERR_PACK(lib,func,reason);\n\tes->err_file[es->top]=file;\n\tes->err_line[es->top]=line;\n\terr_clear_data(es,es->top);\n\t}', 'void CRYPTO_free(void *str)\n\t{\n\tif (free_debug_func != NULL)\n\t\tfree_debug_func(str, 0);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\\n", str);\n#endif\n\tfree_func(str);\n\tif (free_debug_func != NULL)\n\t\tfree_debug_func(NULL, 1);\n\t}']