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


ssl/ssl_cert.c:713:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
711.   #ifndef MAC_OS_pre_X
712.   
713. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
714.   				       const char *dir)
715.   	{

ssl/ssl_cert.c:718:2: 
716.   	DIR *d;
717.   	struct dirent *dstruct;
718. > 	int ret = 0;
719.   
720.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:720:2: 
718.   	int ret = 0;
719.   
720. > 	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
721.   	d = opendir(dir);
722.   

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:721:2: 
719.   
720.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
721. > 	d = opendir(dir);
722.   
723.   	/* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:724:6: Taking false branch
722.   
723.   	/* Note that a side effect is that the CAs will be sorted by name */
724.   	if(!d)
            ^
725.   		{
726.   		SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:732:9: Loop condition is true. Entering loop body
730.   		}
731.   	
732.   	while((dstruct=readdir(d)))
               ^
733.   		{
734.   		char buf[1024];

ssl/ssl_cert.c:737:6: Taking false branch
735.   		int r;
736.   		
737.   		if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
            ^
738.   			{
739.   			SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);

ssl/ssl_cert.c:743:3: Skipping BIO_snprintf(): empty list of specs
741.   			}
742.   		
743.   		r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name);
         ^
744.   		if (r <= 0 || r >= sizeof buf)
745.   			goto err;

ssl/ssl_cert.c:744:7: Taking false branch
742.   		
743.   		r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name);
744.   		if (r <= 0 || r >= sizeof buf)
             ^
745.   			goto err;
746.   		if(!SSL_add_file_cert_subjects_to_stack(stack,buf))

ssl/ssl_cert.c:744:17: Taking false branch
742.   		
743.   		r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name);
744.   		if (r <= 0 || r >= sizeof buf)
                       ^
745.   			goto err;
746.   		if(!SSL_add_file_cert_subjects_to_stack(stack,buf))

ssl/ssl_cert.c:746:7: Taking true branch
744.   		if (r <= 0 || r >= sizeof buf)
745.   			goto err;
746.   		if(!SSL_add_file_cert_subjects_to_stack(stack,buf))
             ^
747.   			goto err;
748.   		}
