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


ssl/ssl_cert.c:694:1: start of procedure SSL_add_dir_cert_subjects_to_stack()
692.   #ifndef MAC_OS_pre_X
693.   
694. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
695.   				       const char *dir)
696.       {

ssl/ssl_cert.c:699:5: 
697.       DIR *d;
698.       struct dirent *dstruct;
699. >     int ret = 0;
700.   
701.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);

ssl/ssl_cert.c:701:5: 
699.       int ret = 0;
700.   
701. >     CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
702.       d = opendir(dir);
703.   

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:702:5: 
700.   
701.       CRYPTO_w_lock(CRYPTO_LOCK_READDIR);
702. >     d = opendir(dir);
703.   
704.       /* Note that a side effect is that the CAs will be sorted by name */

ssl/ssl_cert.c:705:9: Taking false branch
703.   
704.       /* Note that a side effect is that the CAs will be sorted by name */
705.       if(!d)
               ^
706.   	{
707.   	SYSerr(SYS_F_OPENDIR, get_last_sys_error());

ssl/ssl_cert.c:713:12: Loop condition is true. Entering loop body
711.   	}
712.   
713.       while((dstruct=readdir(d)))
                  ^
714.   	{
715.   	char buf[1024];

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

ssl/ssl_cert.c:723:2: 
721.   	    }
722.   	
723. > 	sprintf(buf,"%s/%s",dir,dstruct->d_name);
724.   	if(!SSL_add_file_cert_subjects_to_stack(stack,buf))
725.   	    goto err;

ssl/ssl_cert.c:724:6: Taking false branch
722.   	
723.   	sprintf(buf,"%s/%s",dir,dstruct->d_name);
724.   	if(!SSL_add_file_cert_subjects_to_stack(stack,buf))
            ^
725.   	    goto err;
726.   	}

ssl/ssl_cert.c:713:12: Loop condition is false. Leaving loop
711.   	}
712.   
713.       while((dstruct=readdir(d)))
                  ^
714.   	{
715.   	char buf[1024];

ssl/ssl_cert.c:727:5: 
725.   	    goto err;
726.   	}
727. >     ret = 1;
728.   
729.   err:	
