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


ssl/ssl_cert.c:737:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
735.   #ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! */
736.   
737. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
738.   				       const char *dir)
739.   	{

ssl/ssl_cert.c:742:2: 
740.   	DIR *d;
741.   	struct dirent *dstruct;
742. > 	int ret = 0;
743.   
744.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:744:2: 
742.   	int ret = 0;
743.   
744. > 	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
745.   	d = opendir(dir);
746.   

crypto/cryptlib.c:379:1: start of procedure CRYPTO_lock()
  377.   	}
  378.   
  379. > void CRYPTO_lock(int mode, int type, const char *file, int line)
  380.   	{
  381.   #ifdef LOCK_DEBUG

crypto/cryptlib.c:404:6: Taking false branch
  402.   		}
  403.   #endif
  404.   	if (type < 0)
              ^
  405.   		{
  406.   		struct CRYPTO_dynlock_value *pointer

crypto/cryptlib.c:417:7: Taking true branch
  415.   		}
  416.   	else
  417.   		if (locking_callback != NULL)
               ^
  418.   			locking_callback(mode,type,file,line);
  419.   	}

crypto/cryptlib.c:418:4: Skipping __function_pointer__(): unresolved function pointer
  416.   	else
  417.   		if (locking_callback != NULL)
  418.   			locking_callback(mode,type,file,line);
            ^
  419.   	}
  420.   

crypto/cryptlib.c:404:2: 
  402.   		}
  403.   #endif
  404. > 	if (type < 0)
  405.   		{
  406.   		struct CRYPTO_dynlock_value *pointer

crypto/cryptlib.c:419:2: return from a call to CRYPTO_lock
  417.   		if (locking_callback != NULL)
  418.   			locking_callback(mode,type,file,line);
  419.   	}
          ^
  420.   
  421.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

ssl/ssl_cert.c:745:2: 
743.   
744.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
745. > 	d = opendir(dir);
746.   
747.   	/* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:748:6: Taking false branch
746.   
747.   	/* Note that a side effect is that the CAs will be sorted by name */
748.   	if(!d)
            ^
749.   		{
750.   		SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:756:9: Loop condition is false. Leaving loop
754.   		}
755.   	
756.   	while((dstruct=readdir(d)))
               ^
757.   		{
758.   		char buf[1024];

ssl/ssl_cert.c:773:2: 
771.   			goto err;
772.   		}
773. > 	ret = 1;
774.   
775.   err:	
