ssl/ssl_cert.c:749: error: RESOURCE_LEAK
  resource acquired by call to `opendir()` at line 731, column 6 is not released after line 749, column 4.
Showing all 24 steps of the trace


ssl/ssl_cert.c:723:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
721.   #ifndef MAC_OS_pre_X
722.   
723. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
724.   				       const char *dir)
725.   	{

ssl/ssl_cert.c:728:2: 
726.   	DIR *d;
727.   	struct dirent *dstruct;
728. > 	int ret = 0;
729.   
730.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:730:2: 
728.   	int ret = 0;
729.   
730. > 	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
731.   	d = opendir(dir);
732.   

crypto/cryptlib.c:372:1: start of procedure CRYPTO_lock()
  370.   	}
  371.   
  372. > void CRYPTO_lock(int mode, int type, const char *file, int line)
  373.   	{
  374.   #ifdef LOCK_DEBUG

crypto/cryptlib.c:397:6: Taking false branch
  395.   		}
  396.   #endif
  397.   	if (type < 0)
              ^
  398.   		{
  399.   		int i = -type - 1;

crypto/cryptlib.c:411:7: Taking true branch
  409.   		}
  410.   	else
  411.   		if (locking_callback != NULL)
               ^
  412.   			locking_callback(mode,type,file,line);
  413.   	}

crypto/cryptlib.c:412:4: Skipping __function_pointer__(): unresolved function pointer
  410.   	else
  411.   		if (locking_callback != NULL)
  412.   			locking_callback(mode,type,file,line);
            ^
  413.   	}
  414.   

crypto/cryptlib.c:397:2: 
  395.   		}
  396.   #endif
  397. > 	if (type < 0)
  398.   		{
  399.   		int i = -type - 1;

crypto/cryptlib.c:413:2: return from a call to CRYPTO_lock
  411.   		if (locking_callback != NULL)
  412.   			locking_callback(mode,type,file,line);
  413.   	}
          ^
  414.   
  415.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

ssl/ssl_cert.c:731:2: 
729.   
730.   	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
731. > 	d = opendir(dir);
732.   
733.   	/* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:734:6: Taking false branch
732.   
733.   	/* Note that a side effect is that the CAs will be sorted by name */
734.   	if(!d)
            ^
735.   		{
736.   		SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:742:9: Loop condition is true. Entering loop body
740.   		}
741.   	
742.   	while((dstruct=readdir(d)))
               ^
743.   		{
744.   		char buf[1024];

ssl/ssl_cert.c:747:6: Taking true branch
745.   		int r;
746.   		
747.   		if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
            ^
748.   			{
749.   			SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);

ssl/ssl_cert.c:749:4: 
747.   		if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)
748.   			{
749. > 			SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);
750.   			goto err;
751.   			}

crypto/err/err.c:360:1: start of procedure ERR_put_error()
  358.   /********************************************************/
  359.   
  360. > void ERR_put_error(int lib, int func, int reason, const char *file,
  361.   	     int line)
  362.   	{

crypto/err/err.c:384:2: Skipping ERR_get_state(): empty list of specs
  382.   	}
  383.   #endif
  384.   	es=ERR_get_state();
          ^
  385.   
  386.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:386:2: 
  384.   	es=ERR_get_state();
  385.   
  386. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
  387.   	if (es->top == es->bottom)
  388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:387:6: Taking false branch
  385.   
  386.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
  387.   	if (es->top == es->bottom)
              ^
  388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:389:2: 
  387.   	if (es->top == es->bottom)
  388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  389. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  390.   	es->err_file[es->top]=file;
  391.   	es->err_line[es->top]=line;

crypto/err/err.c:390:2: 
  388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  390. > 	es->err_file[es->top]=file;
  391.   	es->err_line[es->top]=line;
  392.   	err_clear_data(es,es->top);

crypto/err/err.c:391:2: 
  389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  390.   	es->err_file[es->top]=file;
  391. > 	es->err_line[es->top]=line;
  392.   	err_clear_data(es,es->top);
  393.   	}

crypto/err/err.c:392:2: Taking true branch
  390.   	es->err_file[es->top]=file;
  391.   	es->err_line[es->top]=line;
  392.   	err_clear_data(es,es->top);
          ^
  393.   	}
  394.   

crypto/err/err.c:392:2: Taking false branch
  390.   	es->err_file[es->top]=file;
  391.   	es->err_line[es->top]=line;
  392.   	err_clear_data(es,es->top);
          ^
  393.   	}
  394.   

crypto/err/err.c:393:2: return from a call to ERR_put_error
  391.   	es->err_line[es->top]=line;
  392.   	err_clear_data(es,es->top);
  393.   	}
          ^
  394.   
  395.   void ERR_clear_error(void)
