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


ssl/ssl_cert.c:693:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
691.   #ifndef MAC_OS_pre_X
692.   
693. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
694.   				       const char *dir)
695.       {

ssl/ssl_cert.c:698:5: 
696.       DIR *d;
697.       struct dirent *dstruct;
698. >     int ret = 0;
699.   
700.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:700:5: 
698.       int ret = 0;
699.   
700. >     CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
701.       d = opendir(dir);
702.   

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

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

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

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

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

ssl/ssl_cert.c:701:5: 
699.   
700.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
701. >     d = opendir(dir);
702.   
703.       /* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:704:9: Taking false branch
702.   
703.       /* Note that a side effect is that the CAs will be sorted by name */
704.       if(!d)
               ^
705.   	{
706.   	SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:712:12: Loop condition is false. Leaving loop
710.   	}
711.   
712.       while((dstruct=readdir(d)))
                  ^
713.   	{
714.   	char buf[1024];

ssl/ssl_cert.c:726:5: 
724.   	    goto err;
725.   	}
726. >     ret = 1;
727.   
728.   err:	
