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


ssl/ssl_cert.c:725:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
723.   #ifndef MAC_OS_pre_X
724.   
725. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
726.   				       const char *dir)
727.   	{

ssl/ssl_cert.c:730:2: 
728.   	DIR *d;
729.   	struct dirent *dstruct;
730. > 	int ret = 0;
731.   
732.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:732:2: 
730.   	int ret = 0;
731.   
732. > 	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
733.   	d = opendir(dir);
734.   

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:733:2: 
731.   
732.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
733. > 	d = opendir(dir);
734.   
735.   	/* Note that a side effect is that the CAs will be sorted by name */

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

ssl/ssl_cert.c:744:9: Loop condition is true. Entering loop body
742.   		}
743.   	
744.   	while((dstruct=readdir(d)))
               ^
745.   		{
746.   		char buf[1024];

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

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

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