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


crypto/bio/bss_file.c:107:1: start of procedure BIO_new_file()
105.   	};
106.   
107. > BIO *BIO_new_file(char *filename, char *mode)
108.   	{
109.   	BIO *ret;

crypto/bio/bss_file.c:112:6: Taking false branch
110.   	FILE *file;
111.   
112.   	if ((file=fopen(filename,mode)) == NULL)
            ^
113.   		{
114.   		SYSerr(SYS_F_FOPEN,get_last_sys_error());

crypto/bio/bss_file.c:119:6: 
117.   		return(NULL);
118.   		}
119. > 	if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
120.   		return(NULL);
121.   

crypto/bio/bss_file.c:137:1: start of procedure BIO_s_file()
  135.   	}
  136.   
  137. > BIO_METHOD *BIO_s_file(void)
  138.   	{
  139.   	return(&methods_filep);

crypto/bio/bss_file.c:139:2: 
  137.   BIO_METHOD *BIO_s_file(void)
  138.   	{
  139. > 	return(&methods_filep);
  140.   	}
  141.   

crypto/bio/bss_file.c:140:2: return from a call to BIO_s_file
  138.   	{
  139.   	return(&methods_filep);
  140.   	}
          ^
  141.   
  142.   static int MS_CALLBACK file_new(BIO *bi)

crypto/bio/bss_file.c:119:6: Taking true branch
117.   		return(NULL);
118.   		}
119.   	if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
            ^
120.   		return(NULL);
121.   

crypto/bio/bss_file.c:120:3: 
118.   		}
119.   	if ((ret=BIO_new(BIO_s_file_internal())) == NULL)
120. > 		return(NULL);
121.   
122.   	BIO_set_fp(ret,file,BIO_CLOSE);

BIO *BIO_new_file(char *filename, 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,"')");
		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(char *filename, 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\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}']