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


ssl/ssl_cert.c:675:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
673.   #ifndef VMS			/* XXXX This may be fixed in the future */
674.   
675. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
676.   				       const char *dir)
677.       {

ssl/ssl_cert.c:680:5: 
678.       DIR *d;
679.       struct dirent *dstruct;
680. >     int ret = 0;
681.   
682.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:682:5: 
680.       int ret = 0;
681.   
682. >     CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
683.       d = opendir(dir);
684.   

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

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

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

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

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

ssl/ssl_cert.c:683:5: 
681.   
682.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
683. >     d = opendir(dir);
684.   
685.       /* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:686:9: Taking false branch
684.   
685.       /* Note that a side effect is that the CAs will be sorted by name */
686.       if(!d)
               ^
687.   	{
688.   	SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:694:12: Loop condition is false. Leaving loop
692.   	}
693.   
694.       while((dstruct=readdir(d)))
                  ^
695.   	{
696.   	char buf[1024];

ssl/ssl_cert.c:708:5: 
706.   	    goto err;
707.   	}
708. >     ret = 1;
709.   
710.   err:	
