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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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