apps/apps.c:1075: error: NULL_DEREFERENCE
  pointer `pkey` last assigned on line 1046 could be null and is dereferenced by call to `EVP_PKEY_free()` at line 1075, column 2.
Showing all 74 steps of the trace


apps/apps.c:1035:1: start of procedure load_netscape_key()
1033.   
1034.   #if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
1035. > static EVP_PKEY *
1036.   load_netscape_key(BIO *err, BIO *key, const char *file,
1037.   		const char *key_descrip, int format)

apps/apps.c:1045:2: 
1043.   	int size, i;
1044.   
1045. > 	buf=BUF_MEM_new();
1046.   	pkey = EVP_PKEY_new();
1047.   	size = 0;

crypto/buffer/buffer.c:63:1: start of procedure BUF_MEM_new()
  61.   #include <openssl/buffer.h>
  62.   
  63. > BUF_MEM *BUF_MEM_new(void)
  64.   	{
  65.   	BUF_MEM *ret;

crypto/buffer/buffer.c:67:2: 
  65.   	BUF_MEM *ret;
  66.   
  67. > 	ret=OPENSSL_malloc(sizeof(BUF_MEM));
  68.   	if (ret == NULL)
  69.   		{

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 true branch
    297.   
    298.   	allow_customize = 0;
    299.   	if (malloc_debug_func != NULL)
                ^
    300.   		{
    301.   		allow_customize_debug = 0;

crypto/mem.c:301:3: 
    299.   	if (malloc_debug_func != NULL)
    300.   		{
    301. > 		allow_customize_debug = 0;
    302.   		malloc_debug_func(NULL, num, file, line, 0);
    303.   		}

crypto/mem.c:302:3: Skipping __function_pointer__(): unresolved function pointer
    300.   		{
    301.   		allow_customize_debug = 0;
    302.   		malloc_debug_func(NULL, num, file, line, 0);
             ^
    303.   		}
    304.   	ret = malloc_ex_func(num,file,line);

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 true 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:309:3: Skipping __function_pointer__(): unresolved function pointer
    307.   #endif
    308.   	if (malloc_debug_func != NULL)
    309.   		malloc_debug_func(ret, num, file, line, 1);
             ^
    310.   
    311.           /* Create a dependency on the value of 'cleanse_ctr' so our memory

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/buffer/buffer.c:68:6: Taking true branch
  66.   
  67.   	ret=OPENSSL_malloc(sizeof(BUF_MEM));
  68.   	if (ret == NULL)
             ^
  69.   		{
  70.   		BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);

crypto/buffer/buffer.c:70:3: 
  68.   	if (ret == NULL)
  69.   		{
  70. > 		BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);
  71.   		return(NULL);
  72.   		}

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

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

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

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

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

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

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

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

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

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

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

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

crypto/buffer/buffer.c:71:3: 
  69.   		{
  70.   		BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);
  71. > 		return(NULL);
  72.   		}
  73.   	ret->length=0;

crypto/buffer/buffer.c:77:2: return from a call to BUF_MEM_new
  75.   	ret->data=NULL;
  76.   	return(ret);
  77.   	}
         ^
  78.   
  79.   void BUF_MEM_free(BUF_MEM *a)

apps/apps.c:1046:2: 
1044.   
1045.   	buf=BUF_MEM_new();
1046. > 	pkey = EVP_PKEY_new();
1047.   	size = 0;
1048.   	if (buf == NULL || pkey == NULL)

crypto/evp/p_lib.c:313:1: start of procedure EVP_PKEY_new()
  311.   	}
  312.   
  313. > EVP_PKEY *EVP_PKEY_new(void)
  314.   	{
  315.   	EVP_PKEY *ret;

crypto/evp/p_lib.c:317:2: 
  315.   	EVP_PKEY *ret;
  316.   
  317. > 	ret=(EVP_PKEY *)OPENSSL_malloc(sizeof(EVP_PKEY));
  318.   	if (ret == NULL)
  319.   		{

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 true branch
    297.   
    298.   	allow_customize = 0;
    299.   	if (malloc_debug_func != NULL)
                ^
    300.   		{
    301.   		allow_customize_debug = 0;

crypto/mem.c:301:3: 
    299.   	if (malloc_debug_func != NULL)
    300.   		{
    301. > 		allow_customize_debug = 0;
    302.   		malloc_debug_func(NULL, num, file, line, 0);
    303.   		}

crypto/mem.c:302:3: Skipping __function_pointer__(): unresolved function pointer
    300.   		{
    301.   		allow_customize_debug = 0;
    302.   		malloc_debug_func(NULL, num, file, line, 0);
             ^
    303.   		}
    304.   	ret = malloc_ex_func(num,file,line);

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 true 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:309:3: Skipping __function_pointer__(): unresolved function pointer
    307.   #endif
    308.   	if (malloc_debug_func != NULL)
    309.   		malloc_debug_func(ret, num, file, line, 1);
             ^
    310.   
    311.           /* Create a dependency on the value of 'cleanse_ctr' so our memory

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/evp/p_lib.c:318:6: Taking true branch
  316.   
  317.   	ret=(EVP_PKEY *)OPENSSL_malloc(sizeof(EVP_PKEY));
  318.   	if (ret == NULL)
              ^
  319.   		{
  320.   		EVPerr(EVP_F_EVP_PKEY_NEW,ERR_R_MALLOC_FAILURE);

crypto/evp/p_lib.c:320:3: 
  318.   	if (ret == NULL)
  319.   		{
  320. > 		EVPerr(EVP_F_EVP_PKEY_NEW,ERR_R_MALLOC_FAILURE);
  321.   		return(NULL);
  322.   		}

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

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

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

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

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

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

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

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

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

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

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

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

crypto/evp/p_lib.c:321:3: 
  319.   		{
  320.   		EVPerr(EVP_F_EVP_PKEY_NEW,ERR_R_MALLOC_FAILURE);
  321. > 		return(NULL);
  322.   		}
  323.   	ret->type=EVP_PKEY_NONE;

crypto/evp/p_lib.c:329:2: return from a call to EVP_PKEY_new
  327.   	ret->save_parameters=1;
  328.   	return(ret);
  329.   	}
          ^
  330.   
  331.   int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key)

apps/apps.c:1047:2: 
1045.   	buf=BUF_MEM_new();
1046.   	pkey = EVP_PKEY_new();
1047. > 	size = 0;
1048.   	if (buf == NULL || pkey == NULL)
1049.   		goto error;

apps/apps.c:1048:6: Taking true branch
1046.   	pkey = EVP_PKEY_new();
1047.   	size = 0;
1048.   	if (buf == NULL || pkey == NULL)
             ^
1049.   		goto error;
1050.   	for (;;)

apps/apps.c:1073:1: 
1071.   	EVP_PKEY_set1_RSA(pkey, rsa);
1072.   	return pkey;
1073. > error:
1074.   	BUF_MEM_free(buf);
1075.   	EVP_PKEY_free(pkey);

apps/apps.c:1074:2: 
1072.   	return pkey;
1073.   error:
1074. > 	BUF_MEM_free(buf);
1075.   	EVP_PKEY_free(pkey);
1076.   	return NULL;

crypto/buffer/buffer.c:79:1: start of procedure BUF_MEM_free()
  77.   	}
  78.   
  79. > void BUF_MEM_free(BUF_MEM *a)
  80.   	{
  81.   	if(a == NULL)

crypto/buffer/buffer.c:81:5: Taking true branch
  79.   void BUF_MEM_free(BUF_MEM *a)
  80.   	{
  81.   	if(a == NULL)
            ^
  82.   	    return;
  83.   

crypto/buffer/buffer.c:82:6: 
  80.   	{
  81.   	if(a == NULL)
  82. > 	    return;
  83.   
  84.   	if (a->data != NULL)

crypto/buffer/buffer.c:90:2: return from a call to BUF_MEM_free
  88.   		}
  89.   	OPENSSL_free(a);
  90.   	}
         ^
  91.   
  92.   int BUF_MEM_grow(BUF_MEM *str, int len)

apps/apps.c:1075:2: 
1073.   error:
1074.   	BUF_MEM_free(buf);
1075. > 	EVP_PKEY_free(pkey);
1076.   	return NULL;
1077.   	}

static EVP_PKEY *
load_netscape_key(BIO *err, BIO *key, const char *file,
		const char *key_descrip, int format)
	{
	EVP_PKEY *pkey;
	BUF_MEM *buf;
	RSA	*rsa;
	const unsigned char *p;
	int size, i;
	buf=BUF_MEM_new();
	pkey = EVP_PKEY_new();
	size = 0;
	if (buf == NULL || pkey == NULL)
		goto error;
	for (;;)
		{
		if (!BUF_MEM_grow_clean(buf,size+1024*10))
			goto error;
		i = BIO_read(key, &(buf->data[size]), 1024*10);
		size += i;
		if (i == 0)
			break;
		if (i < 0)
			{
				BIO_printf(err, "Error reading %s %s",
					key_descrip, file);
				goto error;
			}
		}
	p=(unsigned char *)buf->data;
	rsa = d2i_RSA_NET(NULL,&p,(long)size,NULL,
		(format == FORMAT_IISSGC ? 1 : 0));
	if (rsa == NULL)
		goto error;
	BUF_MEM_free(buf);
	EVP_PKEY_set1_RSA(pkey, rsa);
	return pkey;
error:
	BUF_MEM_free(buf);
	EVP_PKEY_free(pkey);
	return NULL;
	}
['static EVP_PKEY *\nload_netscape_key(BIO *err, BIO *key, const char *file,\n\t\tconst char *key_descrip, int format)\n\t{\n\tEVP_PKEY *pkey;\n\tBUF_MEM *buf;\n\tRSA\t*rsa;\n\tconst unsigned char *p;\n\tint size, i;\n\tbuf=BUF_MEM_new();\n\tpkey = EVP_PKEY_new();\n\tsize = 0;\n\tif (buf == NULL || pkey == NULL)\n\t\tgoto error;\n\tfor (;;)\n\t\t{\n\t\tif (!BUF_MEM_grow_clean(buf,size+1024*10))\n\t\t\tgoto error;\n\t\ti = BIO_read(key, &(buf->data[size]), 1024*10);\n\t\tsize += i;\n\t\tif (i == 0)\n\t\t\tbreak;\n\t\tif (i < 0)\n\t\t\t{\n\t\t\t\tBIO_printf(err, "Error reading %s %s",\n\t\t\t\t\tkey_descrip, file);\n\t\t\t\tgoto error;\n\t\t\t}\n\t\t}\n\tp=(unsigned char *)buf->data;\n\trsa = d2i_RSA_NET(NULL,&p,(long)size,NULL,\n\t\t(format == FORMAT_IISSGC ? 1 : 0));\n\tif (rsa == NULL)\n\t\tgoto error;\n\tBUF_MEM_free(buf);\n\tEVP_PKEY_set1_RSA(pkey, rsa);\n\treturn pkey;\nerror:\n\tBUF_MEM_free(buf);\n\tEVP_PKEY_free(pkey);\n\treturn NULL;\n\t}', 'BUF_MEM *BUF_MEM_new(void)\n\t{\n\tBUF_MEM *ret;\n\tret=OPENSSL_malloc(sizeof(BUF_MEM));\n\tif (ret == NULL)\n\t\t{\n\t\tBUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tret->length=0;\n\tret->max=0;\n\tret->data=NULL;\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}', 'EVP_PKEY *EVP_PKEY_new(void)\n\t{\n\tEVP_PKEY *ret;\n\tret=(EVP_PKEY *)OPENSSL_malloc(sizeof(EVP_PKEY));\n\tif (ret == NULL)\n\t\t{\n\t\tEVPerr(EVP_F_EVP_PKEY_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tret->type=EVP_PKEY_NONE;\n\tret->references=1;\n\tret->pkey.ptr=NULL;\n\tret->attributes=NULL;\n\tret->save_parameters=1;\n\treturn(ret);\n\t}', 'void BUF_MEM_free(BUF_MEM *a)\n\t{\n\tif(a == NULL)\n\t    return;\n\tif (a->data != NULL)\n\t\t{\n\t\tmemset(a->data,0,(unsigned int)a->max);\n\t\tOPENSSL_free(a->data);\n\t\t}\n\tOPENSSL_free(a);\n\t}']