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


ssl/ssl_cert.c:733:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
731.   #ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! */
732.   
733. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
734.   				       const char *dir)
735.   	{

ssl/ssl_cert.c:738:2: 
736.   	DIR *d;
737.   	struct dirent *dstruct;
738. > 	int ret = 0;
739.   
740.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:740:2: 
738.   	int ret = 0;
739.   
740. > 	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
741.   	d = opendir(dir);
742.   

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

crypto/cryptlib.c:399:6: Taking false branch
  397.   		}
  398.   #endif
  399.   	if (type < 0)
              ^
  400.   		{
  401.   		struct CRYPTO_dynlock_value *pointer

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

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

crypto/cryptlib.c:399:2: 
  397.   		}
  398.   #endif
  399. > 	if (type < 0)
  400.   		{
  401.   		struct CRYPTO_dynlock_value *pointer

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

ssl/ssl_cert.c:741:2: 
739.   
740.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
741. > 	d = opendir(dir);
742.   
743.   	/* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:744:6: Taking false branch
742.   
743.   	/* Note that a side effect is that the CAs will be sorted by name */
744.   	if(!d)
            ^
745.   		{
746.   		SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:752:9: Loop condition is true. Entering loop body
750.   		}
751.   	
752.   	while((dstruct=readdir(d)))
               ^
753.   		{
754.   		char buf[1024];

ssl/ssl_cert.c:757:6: Taking false branch
755.   		int r;
756.   		
757.   		if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
            ^
758.   			{
759.   			SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);

ssl/ssl_cert.c:763:3: Skipping BIO_snprintf(): empty list of specs
761.   			}
762.   		
763.   		r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name);
         ^
764.   		if (r <= 0 || r >= sizeof buf)
765.   			goto err;

ssl/ssl_cert.c:764:7: Taking true branch
762.   		
763.   		r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name);
764.   		if (r <= 0 || r >= sizeof buf)
             ^
765.   			goto err;
766.   		if(!SSL_add_file_cert_subjects_to_stack(stack,buf))
