engines/e_sureware.c:665: error: NULL_DEREFERENCE
  pointer `rsatmp` last assigned on line 664 could be null and is dereferenced by call to `RSA_set_ex_data()` at line 665, column 3.
Showing all 40 steps of the trace


engines/e_sureware.c:643:1: start of procedure sureware_load_public()
641.   }
642.   
643. > static EVP_PKEY* sureware_load_public(ENGINE *e,const char *key_id,char *hptr,unsigned long el,char keytype)
644.   {
645.   	EVP_PKEY *res = NULL;

engines/e_sureware.c:645:2: 
643.   static EVP_PKEY* sureware_load_public(ENGINE *e,const char *key_id,char *hptr,unsigned long el,char keytype)
644.   {
645. > 	EVP_PKEY *res = NULL;
646.   #ifndef OPENSSL_NO_RSA
647.   	RSA *rsatmp = NULL;

engines/e_sureware.c:647:2: 
645.   	EVP_PKEY *res = NULL;
646.   #ifndef OPENSSL_NO_RSA
647. > 	RSA *rsatmp = NULL;
648.   #endif
649.   #ifndef OPENSSL_NO_DSA

engines/e_sureware.c:650:2: 
648.   #endif
649.   #ifndef OPENSSL_NO_DSA
650. > 	DSA *dsatmp=NULL;
651.   #endif
652.   	char msg[64]="sureware_load_public";

engines/e_sureware.c:652:2: 
650.   	DSA *dsatmp=NULL;
651.   #endif
652. > 	char msg[64]="sureware_load_public";
653.   	int ret=0;
654.   	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)

engines/e_sureware.c:653:2: 
651.   #endif
652.   	char msg[64]="sureware_load_public";
653. > 	int ret=0;
654.   	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
655.   	{

engines/e_sureware.c:654:6: Taking false branch
652.   	char msg[64]="sureware_load_public";
653.   	int ret=0;
654.   	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
            ^
655.   	{
656.   		SUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);

engines/e_sureware.c:654:39: Taking false branch
652.   	char msg[64]="sureware_load_public";
653.   	int ret=0;
654.   	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
                                             ^
655.   	{
656.   		SUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);

engines/e_sureware.c:659:2: 
657.   		goto err;
658.   	}
659. > 	switch (keytype)
660.   	{
661.   #ifndef OPENSSL_NO_RSA

engines/e_sureware.c:662:2: Switch condition is true. Entering switch case
660.   	{
661.   #ifndef OPENSSL_NO_RSA
662.   	case 1: /*RSA*/
        ^
663.   		/* set private external reference */
664.   		rsatmp = RSA_new_method(e);

engines/e_sureware.c:664:3: 
662.   	case 1: /*RSA*/
663.   		/* set private external reference */
664. > 		rsatmp = RSA_new_method(e);
665.   		RSA_set_ex_data(rsatmp,rsaHndidx,hptr);
666.   		rsatmp->flags |= RSA_FLAG_EXT_PKEY;

crypto/rsa/rsa_lib.c:128:1: start of procedure RSA_new_method()
  126.   	}
  127.   
  128. > RSA *RSA_new_method(ENGINE *engine)
  129.   	{
  130.   	RSA *ret;

crypto/rsa/rsa_lib.c:132:2: 
  130.   	RSA *ret;
  131.   
  132. > 	ret=(RSA *)OPENSSL_malloc(sizeof(RSA));
  133.   	if (ret == NULL)
  134.   		{

crypto/mem.c:291:1: start of procedure CRYPTO_malloc()
    289.   	}
    290.   
    291. > void *CRYPTO_malloc(int num, const char *file, int line)
    292.   	{
    293.   	void *ret = NULL;

crypto/mem.c:293:2: 
    291.   void *CRYPTO_malloc(int num, const char *file, int line)
    292.   	{
    293. > 	void *ret = NULL;
    294.   	extern unsigned char cleanse_ctr;
    295.   

crypto/mem.c:296:6: Taking false branch
    294.   	extern unsigned char cleanse_ctr;
    295.   
    296.   	if (num <= 0) return NULL;
                ^
    297.   
    298.   	allow_customize = 0;

crypto/mem.c:298:2: 
    296.   	if (num <= 0) return NULL;
    297.   
    298. > 	allow_customize = 0;
    299.   	if (malloc_debug_func != NULL)
    300.   		{

crypto/mem.c:299:6: Taking false branch
    297.   
    298.   	allow_customize = 0;
    299.   	if (malloc_debug_func != NULL)
                ^
    300.   		{
    301.   		allow_customize_debug = 0;

crypto/mem.c:304:2: Skipping __function_pointer__(): unresolved function pointer
    302.   		malloc_debug_func(NULL, num, file, line, 0);
    303.   		}
    304.   	ret = malloc_ex_func(num,file,line);
            ^
    305.   #ifdef LEVITTE_DEBUG_MEM
    306.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:308:6: Taking false branch
    306.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
    307.   #endif
    308.   	if (malloc_debug_func != NULL)
                ^
    309.   		malloc_debug_func(ret, num, file, line, 1);
    310.   

crypto/mem.c:314:12: Taking false branch
    312.            * sanitisation function can't be optimised out. NB: We only do
    313.            * this for >2Kb so the overhead doesn't bother us. */
    314.           if(ret && (num > 2048))
                      ^
    315.                   ((unsigned char *)ret)[0] = cleanse_ctr;
    316.   

crypto/mem.c:317:2: 
    315.                   ((unsigned char *)ret)[0] = cleanse_ctr;
    316.   
    317. > 	return ret;
    318.   	}
    319.   

crypto/mem.c:318:2: return from a call to CRYPTO_malloc
    316.   
    317.   	return ret;
    318.   	}
            ^
    319.   
    320.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/rsa/rsa_lib.c:133:6: Taking true branch
  131.   
  132.   	ret=(RSA *)OPENSSL_malloc(sizeof(RSA));
  133.   	if (ret == NULL)
              ^
  134.   		{
  135.   		RSAerr(RSA_F_RSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);

crypto/rsa/rsa_lib.c:135:3: 
  133.   	if (ret == NULL)
  134.   		{
  135. > 		RSAerr(RSA_F_RSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);
  136.   		return NULL;
  137.   		}

crypto/err/err.c:664:1: start of procedure ERR_put_error()
    662.   /********************************************************/
    663.   
    664. > void ERR_put_error(int lib, int func, int reason, const char *file,
    665.   	     int line)
    666.   	{

crypto/err/err.c:688:2: Skipping ERR_get_state(): empty list of specs
    686.   	}
    687.   #endif
    688.   	es=ERR_get_state();
            ^
    689.   
    690.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:690:2: 
    688.   	es=ERR_get_state();
    689.   
    690. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    691.   	if (es->top == es->bottom)
    692.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:691:6: Taking false branch
    689.   
    690.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    691.   	if (es->top == es->bottom)
                ^
    692.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    693.   	es->err_flags[es->top]=0;

crypto/err/err.c:693:2: 
    691.   	if (es->top == es->bottom)
    692.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    693. > 	es->err_flags[es->top]=0;
    694.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    695.   	es->err_file[es->top]=file;

crypto/err/err.c:694:2: 
    692.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    693.   	es->err_flags[es->top]=0;
    694. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    695.   	es->err_file[es->top]=file;
    696.   	es->err_line[es->top]=line;

crypto/err/err.c:695:2: 
    693.   	es->err_flags[es->top]=0;
    694.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    695. > 	es->err_file[es->top]=file;
    696.   	es->err_line[es->top]=line;
    697.   	err_clear_data(es,es->top);

crypto/err/err.c:696:2: 
    694.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    695.   	es->err_file[es->top]=file;
    696. > 	es->err_line[es->top]=line;
    697.   	err_clear_data(es,es->top);
    698.   	}

crypto/err/err.c:697:2: Taking true branch
    695.   	es->err_file[es->top]=file;
    696.   	es->err_line[es->top]=line;
    697.   	err_clear_data(es,es->top);
            ^
    698.   	}
    699.   

crypto/err/err.c:697:2: Taking false branch
    695.   	es->err_file[es->top]=file;
    696.   	es->err_line[es->top]=line;
    697.   	err_clear_data(es,es->top);
            ^
    698.   	}
    699.   

crypto/err/err.c:697:2: Loop condition is false. Leaving loop
    695.   	es->err_file[es->top]=file;
    696.   	es->err_line[es->top]=line;
    697.   	err_clear_data(es,es->top);
            ^
    698.   	}
    699.   

crypto/err/err.c:698:2: return from a call to ERR_put_error
    696.   	es->err_line[es->top]=line;
    697.   	err_clear_data(es,es->top);
    698.   	}
            ^
    699.   
    700.   void ERR_clear_error(void)

crypto/rsa/rsa_lib.c:136:3: 
  134.   		{
  135.   		RSAerr(RSA_F_RSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);
  136. > 		return NULL;
  137.   		}
  138.   

crypto/rsa/rsa_lib.c:196:2: return from a call to RSA_new_method
  194.   		}
  195.   	return(ret);
  196.   	}
          ^
  197.   
  198.   void RSA_free(RSA *r)

engines/e_sureware.c:665:3: 
663.   		/* set private external reference */
664.   		rsatmp = RSA_new_method(e);
665. > 		RSA_set_ex_data(rsatmp,rsaHndidx,hptr);
666.   		rsatmp->flags |= RSA_FLAG_EXT_PKEY;
667.   

static EVP_PKEY* sureware_load_public(ENGINE *e,const char *key_id,char *hptr,unsigned long el,char keytype)
{
	EVP_PKEY *res = NULL;
#ifndef OPENSSL_NO_RSA
	RSA *rsatmp = NULL;
#endif
#ifndef OPENSSL_NO_DSA
	DSA *dsatmp=NULL;
#endif
	char msg[64]="sureware_load_public";
	int ret=0;
	if(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)
	{
		SUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);
		goto err;
	}
	switch (keytype)
	{
#ifndef OPENSSL_NO_RSA
	case 1:
		rsatmp = RSA_new_method(e);
		RSA_set_ex_data(rsatmp,rsaHndidx,hptr);
		rsatmp->flags |= RSA_FLAG_EXT_PKEY;
		rsatmp->e = BN_new();
		rsatmp->n = BN_new();
		bn_expand2(rsatmp->e, el/sizeof(BN_ULONG));
		bn_expand2(rsatmp->n, el/sizeof(BN_ULONG));
		if (!rsatmp->e || rsatmp->e->dmax!=(int)(el/sizeof(BN_ULONG))||
			!rsatmp->n || rsatmp->n->dmax!=(int)(el/sizeof(BN_ULONG)))
			goto err;
		ret=p_surewarehk_Load_Rsa_Pubkey(msg,key_id,el,
						 (unsigned long *)rsatmp->n->d,
						 (unsigned long *)rsatmp->e->d);
		surewarehk_error_handling(msg,SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ret);
		if (ret!=1)
		{
			SUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
			goto err;
		}
		rsatmp->e->top=el/sizeof(BN_ULONG);
		bn_fix_top(rsatmp->e);
		rsatmp->n->top=el/sizeof(BN_ULONG);
		bn_fix_top(rsatmp->n);
		res = EVP_PKEY_new();
		EVP_PKEY_assign_RSA(res, rsatmp);
		break;
#endif
#ifndef OPENSSL_NO_DSA
	case 2:
		dsatmp = DSA_new_method(e);
		DSA_set_ex_data(dsatmp,dsaHndidx,hptr);
		dsatmp->pub_key = BN_new();
		dsatmp->p = BN_new();
		dsatmp->q = BN_new();
		dsatmp->g = BN_new();
		bn_expand2(dsatmp->pub_key, el/sizeof(BN_ULONG));
		bn_expand2(dsatmp->p, el/sizeof(BN_ULONG));
		bn_expand2(dsatmp->q, 20/sizeof(BN_ULONG));
		bn_expand2(dsatmp->g, el/sizeof(BN_ULONG));
		if (!dsatmp->pub_key || dsatmp->pub_key->dmax!=(int)(el/sizeof(BN_ULONG))||
			!dsatmp->p || dsatmp->p->dmax!=(int)(el/sizeof(BN_ULONG)) ||
			!dsatmp->q || dsatmp->q->dmax!=20/sizeof(BN_ULONG) ||
			!dsatmp->g || dsatmp->g->dmax!=(int)(el/sizeof(BN_ULONG)))
			goto err;
		ret=p_surewarehk_Load_Dsa_Pubkey(msg,key_id,el,
						 (unsigned long *)dsatmp->pub_key->d,
						 (unsigned long *)dsatmp->p->d,
						 (unsigned long *)dsatmp->q->d,
						 (unsigned long *)dsatmp->g->d);
		surewarehk_error_handling(msg,SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ret);
		if (ret!=1)
		{
			SUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
			goto err;
		}
		dsatmp->pub_key->top=el/sizeof(BN_ULONG);
		bn_fix_top(dsatmp->pub_key);
		dsatmp->p->top=el/sizeof(BN_ULONG);
		bn_fix_top(dsatmp->p);
		dsatmp->q->top=20/sizeof(BN_ULONG);
		bn_fix_top(dsatmp->q);
		dsatmp->g->top=el/sizeof(BN_ULONG);
		bn_fix_top(dsatmp->g);
		res = EVP_PKEY_new();
		EVP_PKEY_assign_DSA(res, dsatmp);
		break;
#endif
	default:
		SUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PRIVATE_KEY);
		goto err;
	}
	return res;
 err:
	if (res)
		EVP_PKEY_free(res);
#ifndef OPENSSL_NO_RSA
	if (rsatmp)
		RSA_free(rsatmp);
#endif
#ifndef OPENSSL_NO_DSA
	if (dsatmp)
		DSA_free(dsatmp);
#endif
	return NULL;
}
['static EVP_PKEY* sureware_load_public(ENGINE *e,const char *key_id,char *hptr,unsigned long el,char keytype)\n{\n\tEVP_PKEY *res = NULL;\n#ifndef OPENSSL_NO_RSA\n\tRSA *rsatmp = NULL;\n#endif\n#ifndef OPENSSL_NO_DSA\n\tDSA *dsatmp=NULL;\n#endif\n\tchar msg[64]="sureware_load_public";\n\tint ret=0;\n\tif(!p_surewarehk_Load_Rsa_Pubkey || !p_surewarehk_Load_Dsa_Pubkey)\n\t{\n\t\tSUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ENGINE_R_NOT_INITIALISED);\n\t\tgoto err;\n\t}\n\tswitch (keytype)\n\t{\n#ifndef OPENSSL_NO_RSA\n\tcase 1:\n\t\trsatmp = RSA_new_method(e);\n\t\tRSA_set_ex_data(rsatmp,rsaHndidx,hptr);\n\t\trsatmp->flags |= RSA_FLAG_EXT_PKEY;\n\t\trsatmp->e = BN_new();\n\t\trsatmp->n = BN_new();\n\t\tbn_expand2(rsatmp->e, el/sizeof(BN_ULONG));\n\t\tbn_expand2(rsatmp->n, el/sizeof(BN_ULONG));\n\t\tif (!rsatmp->e || rsatmp->e->dmax!=(int)(el/sizeof(BN_ULONG))||\n\t\t\t!rsatmp->n || rsatmp->n->dmax!=(int)(el/sizeof(BN_ULONG)))\n\t\t\tgoto err;\n\t\tret=p_surewarehk_Load_Rsa_Pubkey(msg,key_id,el,\n\t\t\t\t\t\t (unsigned long *)rsatmp->n->d,\n\t\t\t\t\t\t (unsigned long *)rsatmp->e->d);\n\t\tsurewarehk_error_handling(msg,SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ret);\n\t\tif (ret!=1)\n\t\t{\n\t\t\tSUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);\n\t\t\tgoto err;\n\t\t}\n\t\trsatmp->e->top=el/sizeof(BN_ULONG);\n\t\tbn_fix_top(rsatmp->e);\n\t\trsatmp->n->top=el/sizeof(BN_ULONG);\n\t\tbn_fix_top(rsatmp->n);\n\t\tres = EVP_PKEY_new();\n\t\tEVP_PKEY_assign_RSA(res, rsatmp);\n\t\tbreak;\n#endif\n#ifndef OPENSSL_NO_DSA\n\tcase 2:\n\t\tdsatmp = DSA_new_method(e);\n\t\tDSA_set_ex_data(dsatmp,dsaHndidx,hptr);\n\t\tdsatmp->pub_key = BN_new();\n\t\tdsatmp->p = BN_new();\n\t\tdsatmp->q = BN_new();\n\t\tdsatmp->g = BN_new();\n\t\tbn_expand2(dsatmp->pub_key, el/sizeof(BN_ULONG));\n\t\tbn_expand2(dsatmp->p, el/sizeof(BN_ULONG));\n\t\tbn_expand2(dsatmp->q, 20/sizeof(BN_ULONG));\n\t\tbn_expand2(dsatmp->g, el/sizeof(BN_ULONG));\n\t\tif (!dsatmp->pub_key || dsatmp->pub_key->dmax!=(int)(el/sizeof(BN_ULONG))||\n\t\t\t!dsatmp->p || dsatmp->p->dmax!=(int)(el/sizeof(BN_ULONG)) ||\n\t\t\t!dsatmp->q || dsatmp->q->dmax!=20/sizeof(BN_ULONG) ||\n\t\t\t!dsatmp->g || dsatmp->g->dmax!=(int)(el/sizeof(BN_ULONG)))\n\t\t\tgoto err;\n\t\tret=p_surewarehk_Load_Dsa_Pubkey(msg,key_id,el,\n\t\t\t\t\t\t (unsigned long *)dsatmp->pub_key->d,\n\t\t\t\t\t\t (unsigned long *)dsatmp->p->d,\n\t\t\t\t\t\t (unsigned long *)dsatmp->q->d,\n\t\t\t\t\t\t (unsigned long *)dsatmp->g->d);\n\t\tsurewarehk_error_handling(msg,SUREWARE_F_SUREWAREHK_LOAD_PUBLIC_KEY,ret);\n\t\tif (ret!=1)\n\t\t{\n\t\t\tSUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PUBLIC_KEY);\n\t\t\tgoto err;\n\t\t}\n\t\tdsatmp->pub_key->top=el/sizeof(BN_ULONG);\n\t\tbn_fix_top(dsatmp->pub_key);\n\t\tdsatmp->p->top=el/sizeof(BN_ULONG);\n\t\tbn_fix_top(dsatmp->p);\n\t\tdsatmp->q->top=20/sizeof(BN_ULONG);\n\t\tbn_fix_top(dsatmp->q);\n\t\tdsatmp->g->top=el/sizeof(BN_ULONG);\n\t\tbn_fix_top(dsatmp->g);\n\t\tres = EVP_PKEY_new();\n\t\tEVP_PKEY_assign_DSA(res, dsatmp);\n\t\tbreak;\n#endif\n\tdefault:\n\t\tSUREWAREerr(SUREWARE_F_SUREWAREHK_LOAD_PRIVATE_KEY,ENGINE_R_FAILED_LOADING_PRIVATE_KEY);\n\t\tgoto err;\n\t}\n\treturn res;\n err:\n\tif (res)\n\t\tEVP_PKEY_free(res);\n#ifndef OPENSSL_NO_RSA\n\tif (rsatmp)\n\t\tRSA_free(rsatmp);\n#endif\n#ifndef OPENSSL_NO_DSA\n\tif (dsatmp)\n\t\tDSA_free(dsatmp);\n#endif\n\treturn NULL;\n}', 'RSA *RSA_new_method(ENGINE *engine)\n\t{\n\tRSA *ret;\n\tret=(RSA *)OPENSSL_malloc(sizeof(RSA));\n\tif (ret == NULL)\n\t\t{\n\t\tRSAerr(RSA_F_RSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);\n\t\treturn NULL;\n\t\t}\n\tret->meth = RSA_get_default_method();\n#ifndef OPENSSL_NO_ENGINE\n\tif (engine)\n\t\t{\n\t\tif (!ENGINE_init(engine))\n\t\t\t{\n\t\t\tRSAerr(RSA_F_RSA_NEW_METHOD, ERR_R_ENGINE_LIB);\n\t\t\tOPENSSL_free(ret);\n\t\t\treturn NULL;\n\t\t\t}\n\t\tret->engine = engine;\n\t\t}\n\telse\n\t\tret->engine = ENGINE_get_default_RSA();\n\tif(ret->engine)\n\t\t{\n\t\tret->meth = ENGINE_get_RSA(ret->engine);\n\t\tif(!ret->meth)\n\t\t\t{\n\t\t\tRSAerr(RSA_F_RSA_NEW_METHOD,\n\t\t\t\tERR_R_ENGINE_LIB);\n\t\t\tENGINE_finish(ret->engine);\n\t\t\tOPENSSL_free(ret);\n\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n#endif\n\tret->pad=0;\n\tret->version=0;\n\tret->n=NULL;\n\tret->e=NULL;\n\tret->d=NULL;\n\tret->p=NULL;\n\tret->q=NULL;\n\tret->dmp1=NULL;\n\tret->dmq1=NULL;\n\tret->iqmp=NULL;\n\tret->references=1;\n\tret->_method_mod_n=NULL;\n\tret->_method_mod_p=NULL;\n\tret->_method_mod_q=NULL;\n\tret->blinding=NULL;\n\tret->bignum_data=NULL;\n\tret->flags=ret->meth->flags;\n\tCRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data);\n\tif ((ret->meth->init != NULL) && !ret->meth->init(ret))\n\t\t{\n#ifndef OPENSSL_NO_ENGINE\n\t\tif (ret->engine)\n\t\t\tENGINE_finish(ret->engine);\n#endif\n\t\tCRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data);\n\t\tOPENSSL_free(ret);\n\t\tret=NULL;\n\t\t}\n\treturn(ret);\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_flags[es->top]=0;\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}']