crypto/bio/bss_file.c:113: error: RESOURCE_LEAK
  resource of type `_IO_FILE` acquired to `return` by call to `fopen()` at line 102, column 12 is not released after line 113, column 3.
Showing all 33 steps of the trace


crypto/bio/bss_file.c:97:1: start of procedure BIO_new_file()
95.   	};
96.   
97. > BIO *BIO_new_file(const char *filename, const char *mode)
98.   	{
99.   	BIO *ret;

crypto/bio/bss_file.c:102:6: Taking false branch
100.   	FILE *file;
101.   
102.   	if ((file=fopen(filename,mode)) == NULL)
            ^
103.   		{
104.   		SYSerr(SYS_F_FOPEN,get_last_sys_error());

crypto/bio/bss_file.c:112:6: 
110.   		return(NULL);
111.   		}
112. > 	if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
113.   		return(NULL);
114.   

crypto/bio/bss_file.c:130:1: start of procedure BIO_s_file()
  128.   	}
  129.   
  130. > BIO_METHOD *BIO_s_file(void)
  131.   	{
  132.   	return(&methods_filep);

crypto/bio/bss_file.c:132:2: 
  130.   BIO_METHOD *BIO_s_file(void)
  131.   	{
  132. > 	return(&methods_filep);
  133.   	}
  134.   

crypto/bio/bss_file.c:133:2: return from a call to BIO_s_file
  131.   	{
  132.   	return(&methods_filep);
  133.   	}
          ^
  134.   
  135.   static int MS_CALLBACK file_new(BIO *bi)

crypto/bio/bio_lib.c:66:1: start of procedure BIO_new()
  64.   #include <openssl/stack.h>
  65.   
  66. > BIO *BIO_new(BIO_METHOD *method)
  67.   	{
  68.   	BIO *ret=NULL;

crypto/bio/bio_lib.c:68:2: 
  66.   BIO *BIO_new(BIO_METHOD *method)
  67.   	{
  68. > 	BIO *ret=NULL;
  69.   
  70.   	ret=(BIO *)OPENSSL_malloc(sizeof(BIO));

crypto/bio/bio_lib.c:70:2: 
  68.   	BIO *ret=NULL;
  69.   
  70. > 	ret=(BIO *)OPENSSL_malloc(sizeof(BIO));
  71.   	if (ret == NULL)
  72.   		{

crypto/mem.c:282:1: start of procedure CRYPTO_malloc()
    280.   	}
    281.   
    282. > void *CRYPTO_malloc(int num, const char *file, int line)
    283.   	{
    284.   	void *ret = NULL;

crypto/mem.c:284:2: 
    282.   void *CRYPTO_malloc(int num, const char *file, int line)
    283.   	{
    284. > 	void *ret = NULL;
    285.   
    286.   	allow_customize = 0;

crypto/mem.c:286:2: 
    284.   	void *ret = NULL;
    285.   
    286. > 	allow_customize = 0;
    287.   	if (malloc_debug_func != NULL)
    288.   		{

crypto/mem.c:287:6: Taking false branch
    285.   
    286.   	allow_customize = 0;
    287.   	if (malloc_debug_func != NULL)
                ^
    288.   		{
    289.   		allow_customize_debug = 0;

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

crypto/mem.c:296:6: Taking false branch
    294.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
    295.   #endif
    296.   	if (malloc_debug_func != NULL)
                ^
    297.   		malloc_debug_func(ret, num, file, line, 1);
    298.   

crypto/mem.c:299:2: 
    297.   		malloc_debug_func(ret, num, file, line, 1);
    298.   
    299. > 	return ret;
    300.   	}
    301.   

crypto/mem.c:300:2: return from a call to CRYPTO_malloc
    298.   
    299.   	return ret;
    300.   	}
            ^
    301.   
    302.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/bio/bio_lib.c:71:6: Taking true branch
  69.   
  70.   	ret=(BIO *)OPENSSL_malloc(sizeof(BIO));
  71.   	if (ret == NULL)
             ^
  72.   		{
  73.   		BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE);

crypto/bio/bio_lib.c:73:3: 
  71.   	if (ret == NULL)
  72.   		{
  73. > 		BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE);
  74.   		return(NULL);
  75.   		}

crypto/err/err.c:615:1: start of procedure ERR_put_error()
    613.   /********************************************************/
    614.   
    615. > void ERR_put_error(int lib, int func, int reason, const char *file,
    616.   	     int line)
    617.   	{

crypto/err/err.c:639:2: Skipping ERR_get_state(): empty list of specs
    637.   	}
    638.   #endif
    639.   	es=ERR_get_state();
            ^
    640.   
    641.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:641:2: 
    639.   	es=ERR_get_state();
    640.   
    641. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    642.   	if (es->top == es->bottom)
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:642:6: Taking false branch
    640.   
    641.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    642.   	if (es->top == es->bottom)
                ^
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:644:2: 
    642.   	if (es->top == es->bottom)
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;

crypto/err/err.c:645:2: 
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645. > 	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);

crypto/err/err.c:646:2: 
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645.   	es->err_file[es->top]=file;
    646. > 	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
    648.   	}

crypto/err/err.c:647:2: Taking true branch
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
            ^
    648.   	}
    649.   

crypto/err/err.c:647:2: Taking false branch
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
            ^
    648.   	}
    649.   

crypto/err/err.c:648:2: return from a call to ERR_put_error
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
    648.   	}
            ^
    649.   
    650.   void ERR_clear_error(void)

crypto/bio/bio_lib.c:74:3: 
  72.   		{
  73.   		BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE);
  74. > 		return(NULL);
  75.   		}
  76.   	if (!BIO_set(ret,method))

crypto/bio/bio_lib.c:82:2: return from a call to BIO_new
  80.   		}
  81.   	return(ret);
  82.   	}
         ^
  83.   
  84.   int BIO_set(BIO *bio, BIO_METHOD *method)

crypto/bio/bss_file.c:112:6: Taking true branch
110.   		return(NULL);
111.   		}
112.   	if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
            ^
113.   		return(NULL);
114.   

crypto/bio/bss_file.c:113:3: 
111.   		}
112.   	if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
113. > 		return(NULL);
114.   
115.   	BIO_set_fp(ret,file,BIO_CLOSE);

BIO *BIO_new_file(const char *filename, const char *mode)
	{
	BIO *ret;
	FILE *file;
	if ((file=fopen(filename,mode)) == NULL)
		{
		SYSerr(SYS_F_FOPEN,get_last_sys_error());
		ERR_add_error_data(5,"fopen('",filename,"','",mode,"')");
		if (errno == ENOENT)
			BIOerr(BIO_F_BIO_NEW_FILE,BIO_R_NO_SUCH_FILE);
		else
			BIOerr(BIO_F_BIO_NEW_FILE,ERR_R_SYS_LIB);
		return(NULL);
		}
	if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
		return(NULL);
	BIO_set_fp(ret,file,BIO_CLOSE);
	return(ret);
	}
['BIO *BIO_new_file(const char *filename, const char *mode)\n\t{\n\tBIO *ret;\n\tFILE *file;\n\tif ((file=fopen(filename,mode)) == NULL)\n\t\t{\n\t\tSYSerr(SYS_F_FOPEN,get_last_sys_error());\n\t\tERR_add_error_data(5,"fopen(\'",filename,"\',\'",mode,"\')");\n\t\tif (errno == ENOENT)\n\t\t\tBIOerr(BIO_F_BIO_NEW_FILE,BIO_R_NO_SUCH_FILE);\n\t\telse\n\t\t\tBIOerr(BIO_F_BIO_NEW_FILE,ERR_R_SYS_LIB);\n\t\treturn(NULL);\n\t\t}\n\tif ((ret=BIO_new(BIO_s_file_internal())) == NULL)\n\t\treturn(NULL);\n\tBIO_set_fp(ret,file,BIO_CLOSE);\n\treturn(ret);\n\t}', 'BIO_METHOD *BIO_s_file(void)\n\t{\n\treturn(&methods_filep);\n\t}', 'BIO *BIO_new(BIO_METHOD *method)\n\t{\n\tBIO *ret=NULL;\n\tret=(BIO *)OPENSSL_malloc(sizeof(BIO));\n\tif (ret == NULL)\n\t\t{\n\t\tBIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tif (!BIO_set(ret,method))\n\t\t{\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\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\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}']