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


ssl/ssl_cert.c:684:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
682.   #ifndef MAC_OS_pre_X
683.   
684. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
685.   				       const char *dir)
686.       {

ssl/ssl_cert.c:689:5: 
687.       DIR *d;
688.       struct dirent *dstruct;
689. >     int ret = 0;
690.   
691.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:691:5: 
689.       int ret = 0;
690.   
691. >     CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
692.       d = opendir(dir);
693.   

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

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

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

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

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

ssl/ssl_cert.c:692:5: 
690.   
691.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
692. >     d = opendir(dir);
693.   
694.       /* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:695:9: Taking false branch
693.   
694.       /* Note that a side effect is that the CAs will be sorted by name */
695.       if(!d)
               ^
696.   	{
697.   	SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:703:12: Loop condition is false. Leaving loop
701.   	}
702.   
703.       while((dstruct=readdir(d)))
                  ^
704.   	{
705.   	char buf[1024];

ssl/ssl_cert.c:717:5: 
715.   	    goto err;
716.   	}
717. >     ret = 1;
718.   
719.   err:	
