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


ssl/ssl_cert.c:733:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
731.   #ifndef MAC_OS_pre_X
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 false. Leaving loop
750.   		}
751.   	
752.   	while((dstruct=readdir(d)))
               ^
753.   		{
754.   		char buf[1024];

ssl/ssl_cert.c:769:2: 
767.   			goto err;
768.   		}
769. > 	ret = 1;
770.   
771.   err:	
