ssl/ssl_cert.c:718: error: RESOURCE_LEAK
  resource acquired by call to `opendir()` at line 701, column 9 is not released after line 718, column 6.
Showing all 23 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 true. Entering loop body
710.   	}
711.   
712.       while((dstruct=readdir(d)))
                  ^
713.   	{
714.   	char buf[1024];

ssl/ssl_cert.c:716:5: Taking true branch
714.   	char buf[1024];
715.   
716.   	if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
           ^
717.   	    {
718.   	    SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);

ssl/ssl_cert.c:718:6: 
716.   	if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
717.   	    {
718. > 	    SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);
719.   	    goto err;
720.   	    }

crypto/err/err.c:246:1: start of procedure ERR_put_error()
  244.   /********************************************************/
  245.   
  246. > void ERR_put_error(int lib, int func, int reason, const char *file,
  247.   	     int line)
  248.   	{

crypto/err/err.c:270:2: Skipping ERR_get_state(): empty list of specs
  268.   	}
  269.   #endif
  270.   	es=ERR_get_state();
          ^
  271.   
  272.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:272:2: 
  270.   	es=ERR_get_state();
  271.   
  272. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
  273.   	if (es->top == es->bottom)
  274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:273:6: Taking false branch
  271.   
  272.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
  273.   	if (es->top == es->bottom)
              ^
  274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:275:2: 
  273.   	if (es->top == es->bottom)
  274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  275. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  276.   	es->err_file[es->top]=file;
  277.   	es->err_line[es->top]=line;

crypto/err/err.c:276:2: 
  274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  276. > 	es->err_file[es->top]=file;
  277.   	es->err_line[es->top]=line;
  278.   	err_clear_data(es,es->top);

crypto/err/err.c:277:2: 
  275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  276.   	es->err_file[es->top]=file;
  277. > 	es->err_line[es->top]=line;
  278.   	err_clear_data(es,es->top);
  279.   	}

crypto/err/err.c:278:2: Taking true branch
  276.   	es->err_file[es->top]=file;
  277.   	es->err_line[es->top]=line;
  278.   	err_clear_data(es,es->top);
          ^
  279.   	}
  280.   

crypto/err/err.c:278:2: Taking false branch
  276.   	es->err_file[es->top]=file;
  277.   	es->err_line[es->top]=line;
  278.   	err_clear_data(es,es->top);
          ^
  279.   	}
  280.   

crypto/err/err.c:279:2: return from a call to ERR_put_error
  277.   	es->err_line[es->top]=line;
  278.   	err_clear_data(es,es->top);
  279.   	}
          ^
  280.   
  281.   void ERR_clear_error(void)
