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


ssl/ssl_cert.c:729:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
727.   #ifndef MAC_OS_pre_X
728.   
729. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
730.   				       const char *dir)
731.   	{

ssl/ssl_cert.c:734:2: 
732.   	DIR *d;
733.   	struct dirent *dstruct;
734. > 	int ret = 0;
735.   
736.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:736:2: 
734.   	int ret = 0;
735.   
736. > 	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
737.   	d = opendir(dir);
738.   

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

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

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

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

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

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

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

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

ssl/ssl_cert.c:748:9: Loop condition is true. Entering loop body
746.   		}
747.   	
748.   	while((dstruct=readdir(d)))
               ^
749.   		{
750.   		char buf[1024];

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

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

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