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


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

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

ssl/ssl_cert.c:717:2: 
715.   	int ret = 0;
716.   
717. > 	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
718.   	d = opendir(dir);
719.   

crypto/cryptlib.c:198:1: start of procedure CRYPTO_lock()
  196.   	}
  197.   
  198. > void CRYPTO_lock(int mode, int type, const char *file, int line)
  199.   	{
  200.   #ifdef LOCK_DEBUG

crypto/cryptlib.c:223:6: Taking true branch
  221.   		}
  222.   #endif
  223.   	if (locking_callback != NULL)
              ^
  224.   		locking_callback(mode,type,file,line);
  225.   	}

crypto/cryptlib.c:224:3: Skipping __function_pointer__(): unresolved function pointer
  222.   #endif
  223.   	if (locking_callback != NULL)
  224.   		locking_callback(mode,type,file,line);
           ^
  225.   	}
  226.   

crypto/cryptlib.c:223:2: 
  221.   		}
  222.   #endif
  223. > 	if (locking_callback != NULL)
  224.   		locking_callback(mode,type,file,line);
  225.   	}

crypto/cryptlib.c:225:2: return from a call to CRYPTO_lock
  223.   	if (locking_callback != NULL)
  224.   		locking_callback(mode,type,file,line);
  225.   	}
          ^
  226.   
  227.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

ssl/ssl_cert.c:718:2: 
716.   
717.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
718. > 	d = opendir(dir);
719.   
720.   	/* Note that a side effect is that the CAs will be sorted by name */

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

ssl/ssl_cert.c:729:9: Loop condition is false. Leaving loop
727.   		}
728.   	
729.   	while((dstruct=readdir(d)))
               ^
730.   		{
731.   		char buf[1024];

ssl/ssl_cert.c:746:2: 
744.   			goto err;
745.   		}
746. > 	ret = 1;
747.   
748.   err:	
