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


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

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

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

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

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

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

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

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

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

ssl/ssl_cert.c:731:2: 
729.   
730.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
731. > 	d = opendir(dir);
732.   
733.   	/* Note that a side effect is that the CAs will be sorted by name */

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

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

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

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

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

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

ssl/ssl_cert.c:756:7: Taking false branch
754.   		if (r <= 0 || r >= sizeof buf)
755.   			goto err;
756.   		if(!SSL_add_file_cert_subjects_to_stack(stack,buf))
             ^
757.   			goto err;
758.   		}

ssl/ssl_cert.c:742:9: Loop condition is false. Leaving loop
740.   		}
741.   	
742.   	while((dstruct=readdir(d)))
               ^
743.   		{
744.   		char buf[1024];

ssl/ssl_cert.c:759:2: 
757.   			goto err;
758.   		}
759. > 	ret = 1;
760.   
761.   err:	
