ssl/ssl_cert.c:738: error: RESOURCE_LEAK
  resource acquired by call to `opendir()` at line 720, column 6 is not released after line 738, column 4.
Showing all 24 steps of the trace


ssl/ssl_cert.c:712:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
710.   #ifndef MAC_OS_pre_X
711.   
712. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
713.   				       const char *dir)
714.   	{

ssl/ssl_cert.c:717:2: 
715.   	DIR *d;
716.   	struct dirent *dstruct;
717. > 	int ret = 0;
718.   
719.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:719:2: 
717.   	int ret = 0;
718.   
719. > 	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
720.   	d = opendir(dir);
721.   

crypto/cryptlib.c:372:1: start of procedure CRYPTO_lock()
  370.   	}
  371.   
  372. > void CRYPTO_lock(int mode, int type, const char *file, int line)
  373.   	{
  374.   #ifdef LOCK_DEBUG

crypto/cryptlib.c:397:6: Taking false branch
  395.   		}
  396.   #endif
  397.   	if (type < 0)
              ^
  398.   		{
  399.   		int i = -type - 1;

crypto/cryptlib.c:411:7: Taking true branch
  409.   		}
  410.   	else
  411.   		if (locking_callback != NULL)
               ^
  412.   			locking_callback(mode,type,file,line);
  413.   	}

crypto/cryptlib.c:412:4: Skipping __function_pointer__(): unresolved function pointer
  410.   	else
  411.   		if (locking_callback != NULL)
  412.   			locking_callback(mode,type,file,line);
            ^
  413.   	}
  414.   

crypto/cryptlib.c:397:2: 
  395.   		}
  396.   #endif
  397. > 	if (type < 0)
  398.   		{
  399.   		int i = -type - 1;

crypto/cryptlib.c:413:2: return from a call to CRYPTO_lock
  411.   		if (locking_callback != NULL)
  412.   			locking_callback(mode,type,file,line);
  413.   	}
          ^
  414.   
  415.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

ssl/ssl_cert.c:720:2: 
718.   
719.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
720. > 	d = opendir(dir);
721.   
722.   	/* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:723:6: Taking false branch
721.   
722.   	/* Note that a side effect is that the CAs will be sorted by name */
723.   	if(!d)
            ^
724.   		{
725.   		SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:731:9: Loop condition is true. Entering loop body
729.   		}
730.   	
731.   	while((dstruct=readdir(d)))
               ^
732.   		{
733.   		char buf[1024];

ssl/ssl_cert.c:736:6: Taking true branch
734.   		int r;
735.   		
736.   		if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
            ^
737.   			{
738.   			SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);

ssl/ssl_cert.c:738:4: 
736.   		if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
737.   			{
738. > 			SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);
739.   			goto err;
740.   			}

crypto/err/err.c:355:1: start of procedure ERR_put_error()
  353.   /********************************************************/
  354.   
  355. > void ERR_put_error(int lib, int func, int reason, const char *file,
  356.   	     int line)
  357.   	{

crypto/err/err.c:379:2: Skipping ERR_get_state(): empty list of specs
  377.   	}
  378.   #endif
  379.   	es=ERR_get_state();
          ^
  380.   
  381.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:381:2: 
  379.   	es=ERR_get_state();
  380.   
  381. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
  382.   	if (es->top == es->bottom)
  383.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:382:6: Taking false branch
  380.   
  381.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
  382.   	if (es->top == es->bottom)
              ^
  383.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  384.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:384:2: 
  382.   	if (es->top == es->bottom)
  383.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  384. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  385.   	es->err_file[es->top]=file;
  386.   	es->err_line[es->top]=line;

crypto/err/err.c:385:2: 
  383.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  384.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  385. > 	es->err_file[es->top]=file;
  386.   	es->err_line[es->top]=line;
  387.   	err_clear_data(es,es->top);

crypto/err/err.c:386:2: 
  384.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  385.   	es->err_file[es->top]=file;
  386. > 	es->err_line[es->top]=line;
  387.   	err_clear_data(es,es->top);
  388.   	}

crypto/err/err.c:387:2: Taking true branch
  385.   	es->err_file[es->top]=file;
  386.   	es->err_line[es->top]=line;
  387.   	err_clear_data(es,es->top);
          ^
  388.   	}
  389.   

crypto/err/err.c:387:2: Taking false branch
  385.   	es->err_file[es->top]=file;
  386.   	es->err_line[es->top]=line;
  387.   	err_clear_data(es,es->top);
          ^
  388.   	}
  389.   

crypto/err/err.c:388:2: return from a call to ERR_put_error
  386.   	es->err_line[es->top]=line;
  387.   	err_clear_data(es,es->top);
  388.   	}
          ^
  389.   
  390.   void ERR_clear_error(void)
