apps/apps.c:2858: error: RESOURCE_LEAK
  resource of type `_IO_FILE` acquired by call to `fdopen()` at line 2850, column 10 is not released after line 2858, column 16.
Showing all 33 steps of the trace


apps/apps.c:2812:1: start of procedure bio_open_owner()
2810.    * Open a file for writing, owner-read-only.
2811.    */
2812. > BIO *bio_open_owner(const char *filename, int format, int private)
2813.   {
2814.       FILE *fp = NULL;

apps/apps.c:2814:5: 
2812.   BIO *bio_open_owner(const char *filename, int format, int private)
2813.   {
2814. >     FILE *fp = NULL;
2815.       BIO *b = NULL;
2816.       int fd = -1, bflags, mode, textmode;

apps/apps.c:2815:5: 
2813.   {
2814.       FILE *fp = NULL;
2815. >     BIO *b = NULL;
2816.       int fd = -1, bflags, mode, textmode;
2817.   

apps/apps.c:2816:5: 
2814.       FILE *fp = NULL;
2815.       BIO *b = NULL;
2816. >     int fd = -1, bflags, mode, textmode;
2817.   
2818.       if (!private || filename == NULL || strcmp(filename, "-") == 0)

apps/apps.c:2818:10: Taking false branch
2816.       int fd = -1, bflags, mode, textmode;
2817.   
2818.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                 ^
2819.           return bio_open_default(filename, 'w', format);
2820.   

apps/apps.c:2818:21: Taking false branch
2816.       int fd = -1, bflags, mode, textmode;
2817.   
2818.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                            ^
2819.           return bio_open_default(filename, 'w', format);
2820.   

apps/apps.c:2818:41: Taking false branch
2816.       int fd = -1, bflags, mode, textmode;
2817.   
2818.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                                                ^
2819.           return bio_open_default(filename, 'w', format);
2820.   

apps/apps.c:2821:5: 
2819.           return bio_open_default(filename, 'w', format);
2820.   
2821. >     mode = O_WRONLY;
2822.   #ifdef O_CREAT
2823.       mode |= O_CREAT;

apps/apps.c:2823:5: 
2821.       mode = O_WRONLY;
2822.   #ifdef O_CREAT
2823. >     mode |= O_CREAT;
2824.   #endif
2825.   #ifdef O_TRUNC

apps/apps.c:2826:5: 
2824.   #endif
2825.   #ifdef O_TRUNC
2826. >     mode |= O_TRUNC;
2827.   #endif
2828.       textmode = istext(format);

apps/apps.c:2828:5: 
2826.       mode |= O_TRUNC;
2827.   #endif
2828. >     textmode = istext(format);
2829.       if (!textmode) {
2830.   #ifdef O_BINARY

apps/apps.c:2753:1: start of procedure istext()
  2751.    * text and binary input/output on non-Unix platforms
  2752.    */
  2753. > static int istext(int format)
  2754.   {
  2755.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;

apps/apps.c:2755:12: Condition is true
  2753.   static int istext(int format)
  2754.   {
  2755.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
                     ^
  2756.   }
  2757.   

apps/apps.c:2755:5: 
  2753.   static int istext(int format)
  2754.   {
  2755. >     return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2756.   }
  2757.   

apps/apps.c:2756:1: return from a call to istext
  2754.   {
  2755.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2756. > }
  2757.   
  2758.   BIO *dup_bio_in(int format)

apps/apps.c:2829:10: Taking false branch
2827.   #endif
2828.       textmode = istext(format);
2829.       if (!textmode) {
                 ^
2830.   #ifdef O_BINARY
2831.           mode |= O_BINARY;

apps/apps.c:2847:9: 
2845.       else
2846.   #endif
2847. >         fd = open(filename, mode, 0600);
2848.       if (fd < 0)
2849.           goto err;

apps/apps.c:2848:9: Taking false branch
2846.   #endif
2847.           fd = open(filename, mode, 0600);
2848.       if (fd < 0)
                ^
2849.           goto err;
2850.       fp = fdopen(fd, modestr('w', format));

apps/apps.c:2850:5: 
2848.       if (fd < 0)
2849.           goto err;
2850. >     fp = fdopen(fd, modestr('w', format));
2851.       if (fp == NULL)
2852.           goto err;

apps/apps.c:2780:1: start of procedure modestr()
  2778.   }
  2779.   
  2780. > static const char *modestr(char mode, int format)
  2781.   {
  2782.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');

apps/apps.c:2782:5: Condition is true
  2780.   static const char *modestr(char mode, int format)
  2781.   {
  2782.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
              ^
  2783.   
  2784.       switch (mode) {

apps/apps.c:2784:5: 
  2782.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
  2783.   
  2784. >     switch (mode) {
  2785.       case 'a':
  2786.           return istext(format) ? "a" : "ab";

apps/apps.c:2785:5: Switch condition is false. Skipping switch case
  2783.   
  2784.       switch (mode) {
  2785.       case 'a':
              ^
  2786.           return istext(format) ? "a" : "ab";
  2787.       case 'r':

apps/apps.c:2787:5: Switch condition is false. Skipping switch case
  2785.       case 'a':
  2786.           return istext(format) ? "a" : "ab";
  2787.       case 'r':
              ^
  2788.           return istext(format) ? "r" : "rb";
  2789.       case 'w':

apps/apps.c:2789:5: Switch condition is false. Skipping switch case
  2787.       case 'r':
  2788.           return istext(format) ? "r" : "rb";
  2789.       case 'w':
              ^
  2790.           return istext(format) ? "w" : "wb";
  2791.       }

apps/apps.c:2793:5: 
  2791.       }
  2792.       /* The assert above should make sure we never reach this point */
  2793. >     return NULL;
  2794.   }
  2795.   

apps/apps.c:2794:1: return from a call to modestr
  2792.       /* The assert above should make sure we never reach this point */
  2793.       return NULL;
  2794. > }
  2795.   
  2796.   static const char *modeverb(char mode)

apps/apps.c:2851:9: Taking false branch
2849.           goto err;
2850.       fp = fdopen(fd, modestr('w', format));
2851.       if (fp == NULL)
                ^
2852.           goto err;
2853.       bflags = BIO_CLOSE;

apps/apps.c:2853:5: 
2851.       if (fp == NULL)
2852.           goto err;
2853. >     bflags = BIO_CLOSE;
2854.       if (textmode)
2855.           bflags |= BIO_FP_TEXT;

apps/apps.c:2854:9: Taking false branch
2852.           goto err;
2853.       bflags = BIO_CLOSE;
2854.       if (textmode)
                ^
2855.           bflags |= BIO_FP_TEXT;
2856.       b = BIO_new_fp(fp, bflags);

apps/apps.c:2856:5: Skipping BIO_new_fp(): empty list of specs
2854.       if (textmode)
2855.           bflags |= BIO_FP_TEXT;
2856.       b = BIO_new_fp(fp, bflags);
            ^
2857.       if (b)
2858.           return b;

apps/apps.c:2857:9: Taking true branch
2855.           bflags |= BIO_FP_TEXT;
2856.       b = BIO_new_fp(fp, bflags);
2857.       if (b)
                ^
2858.           return b;
2859.   

apps/apps.c:2858:9: 
2856.       b = BIO_new_fp(fp, bflags);
2857.       if (b)
2858. >         return b;
2859.   
2860.    err:
