ssl/ssl_cert.c:735: error: RESOURCE_LEAK
  resource acquired by call to `opendir()` at line 718, column 9 is not released after line 735, column 6.
Showing all 23 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:5: 
713.       DIR *d;
714.       struct dirent *dstruct;
715. >     int ret = 0;
716.   
717.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

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

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:718:5: 
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:9: 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:12: Loop condition is true. Entering loop body
727.   	}
728.   
729.       while((dstruct=readdir(d)))
                  ^
730.   	{
731.   	char buf[1024];

ssl/ssl_cert.c:733:5: Taking true branch
731.   	char buf[1024];
732.   
733.   	if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
           ^
734.   	    {
735.   	    SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);

ssl/ssl_cert.c:735:6: 
733.   	if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
734.   	    {
735. > 	    SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);
736.   	    goto err;
737.   	    }

crypto/err/err.c:350:1: start of procedure ERR_put_error()
  348.   /********************************************************/
  349.   
  350. > void ERR_put_error(int lib, int func, int reason, const char *file,
  351.   	     int line)
  352.   	{

crypto/err/err.c:374:2: Skipping ERR_get_state(): empty list of specs
  372.   	}
  373.   #endif
  374.   	es=ERR_get_state();
          ^
  375.   
  376.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:376:2: 
  374.   	es=ERR_get_state();
  375.   
  376. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
  377.   	if (es->top == es->bottom)
  378.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:377:6: Taking false branch
  375.   
  376.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
  377.   	if (es->top == es->bottom)
              ^
  378.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  379.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:379:2: 
  377.   	if (es->top == es->bottom)
  378.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  379. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  380.   	es->err_file[es->top]=file;
  381.   	es->err_line[es->top]=line;

crypto/err/err.c:380:2: 
  378.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  379.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  380. > 	es->err_file[es->top]=file;
  381.   	es->err_line[es->top]=line;
  382.   	err_clear_data(es,es->top);

crypto/err/err.c:381:2: 
  379.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  380.   	es->err_file[es->top]=file;
  381. > 	es->err_line[es->top]=line;
  382.   	err_clear_data(es,es->top);
  383.   	}

crypto/err/err.c:382:2: Taking true branch
  380.   	es->err_file[es->top]=file;
  381.   	es->err_line[es->top]=line;
  382.   	err_clear_data(es,es->top);
          ^
  383.   	}
  384.   

crypto/err/err.c:382:2: Taking false branch
  380.   	es->err_file[es->top]=file;
  381.   	es->err_line[es->top]=line;
  382.   	err_clear_data(es,es->top);
          ^
  383.   	}
  384.   

crypto/err/err.c:383:2: return from a call to ERR_put_error
  381.   	es->err_line[es->top]=line;
  382.   	err_clear_data(es,es->top);
  383.   	}
          ^
  384.   
  385.   void ERR_clear_error(void)
