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


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

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

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

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

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

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

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

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

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

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

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