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


apps/apps.c:2795:1: start of procedure bio_open_owner()
2793.    * Open a file for writing, owner-read-only.
2794.    */
2795. > BIO *bio_open_owner(const char *filename, int format, int private)
2796.   {
2797.       FILE *fp = NULL;

apps/apps.c:2797:5: 
2795.   BIO *bio_open_owner(const char *filename, int format, int private)
2796.   {
2797. >     FILE *fp = NULL;
2798.       BIO *b = NULL;
2799.       int fd = -1, bflags, mode, textmode;

apps/apps.c:2798:5: 
2796.   {
2797.       FILE *fp = NULL;
2798. >     BIO *b = NULL;
2799.       int fd = -1, bflags, mode, textmode;
2800.   

apps/apps.c:2799:5: 
2797.       FILE *fp = NULL;
2798.       BIO *b = NULL;
2799. >     int fd = -1, bflags, mode, textmode;
2800.   
2801.       if (!private || filename == NULL || strcmp(filename, "-") == 0)

apps/apps.c:2801:10: Taking false branch
2799.       int fd = -1, bflags, mode, textmode;
2800.   
2801.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                 ^
2802.           return bio_open_default(filename, 'w', format);
2803.   

apps/apps.c:2801:21: Taking false branch
2799.       int fd = -1, bflags, mode, textmode;
2800.   
2801.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                            ^
2802.           return bio_open_default(filename, 'w', format);
2803.   

apps/apps.c:2801:41: Taking false branch
2799.       int fd = -1, bflags, mode, textmode;
2800.   
2801.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                                                ^
2802.           return bio_open_default(filename, 'w', format);
2803.   

apps/apps.c:2804:5: 
2802.           return bio_open_default(filename, 'w', format);
2803.   
2804. >     mode = O_WRONLY;
2805.   #ifdef O_CREAT
2806.       mode |= O_CREAT;

apps/apps.c:2806:5: 
2804.       mode = O_WRONLY;
2805.   #ifdef O_CREAT
2806. >     mode |= O_CREAT;
2807.   #endif
2808.   #ifdef O_TRUNC

apps/apps.c:2809:5: 
2807.   #endif
2808.   #ifdef O_TRUNC
2809. >     mode |= O_TRUNC;
2810.   #endif
2811.       textmode = istext(format);

apps/apps.c:2811:5: 
2809.       mode |= O_TRUNC;
2810.   #endif
2811. >     textmode = istext(format);
2812.       if (!textmode) {
2813.   #ifdef O_BINARY

apps/apps.c:2736:1: start of procedure istext()
  2734.    * text and binary input/output on non-Unix platforms
  2735.    */
  2736. > static int istext(int format)
  2737.   {
  2738.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;

apps/apps.c:2738:12: Condition is true
  2736.   static int istext(int format)
  2737.   {
  2738.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
                     ^
  2739.   }
  2740.   

apps/apps.c:2738:5: 
  2736.   static int istext(int format)
  2737.   {
  2738. >     return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2739.   }
  2740.   

apps/apps.c:2739:1: return from a call to istext
  2737.   {
  2738.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2739. > }
  2740.   
  2741.   BIO *dup_bio_in(int format)

apps/apps.c:2812:10: Taking false branch
2810.   #endif
2811.       textmode = istext(format);
2812.       if (!textmode) {
                 ^
2813.   #ifdef O_BINARY
2814.           mode |= O_BINARY;

apps/apps.c:2830:9: 
2828.       else
2829.   #endif
2830. >         fd = open(filename, mode, 0600);
2831.       if (fd < 0)
2832.           goto err;

apps/apps.c:2831:9: Taking false branch
2829.   #endif
2830.           fd = open(filename, mode, 0600);
2831.       if (fd < 0)
                ^
2832.           goto err;
2833.       fp = fdopen(fd, modestr('w', format));

apps/apps.c:2833:5: 
2831.       if (fd < 0)
2832.           goto err;
2833. >     fp = fdopen(fd, modestr('w', format));
2834.       if (fp == NULL)
2835.           goto err;

apps/apps.c:2763:1: start of procedure modestr()
  2761.   }
  2762.   
  2763. > static const char *modestr(char mode, int format)
  2764.   {
  2765.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');

apps/apps.c:2765:5: Condition is true
  2763.   static const char *modestr(char mode, int format)
  2764.   {
  2765.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
              ^
  2766.   
  2767.       switch (mode) {

apps/apps.c:2767:5: 
  2765.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
  2766.   
  2767. >     switch (mode) {
  2768.       case 'a':
  2769.           return istext(format) ? "a" : "ab";

apps/apps.c:2768:5: Switch condition is false. Skipping switch case
  2766.   
  2767.       switch (mode) {
  2768.       case 'a':
              ^
  2769.           return istext(format) ? "a" : "ab";
  2770.       case 'r':

apps/apps.c:2770:5: Switch condition is false. Skipping switch case
  2768.       case 'a':
  2769.           return istext(format) ? "a" : "ab";
  2770.       case 'r':
              ^
  2771.           return istext(format) ? "r" : "rb";
  2772.       case 'w':

apps/apps.c:2772:5: Switch condition is false. Skipping switch case
  2770.       case 'r':
  2771.           return istext(format) ? "r" : "rb";
  2772.       case 'w':
              ^
  2773.           return istext(format) ? "w" : "wb";
  2774.       }

apps/apps.c:2776:5: 
  2774.       }
  2775.       /* The assert above should make sure we never reach this point */
  2776. >     return NULL;
  2777.   }
  2778.   

apps/apps.c:2777:1: return from a call to modestr
  2775.       /* The assert above should make sure we never reach this point */
  2776.       return NULL;
  2777. > }
  2778.   
  2779.   static const char *modeverb(char mode)

apps/apps.c:2834:9: Taking false branch
2832.           goto err;
2833.       fp = fdopen(fd, modestr('w', format));
2834.       if (fp == NULL)
                ^
2835.           goto err;
2836.       bflags = BIO_CLOSE;

apps/apps.c:2836:5: 
2834.       if (fp == NULL)
2835.           goto err;
2836. >     bflags = BIO_CLOSE;
2837.       if (textmode)
2838.           bflags |= BIO_FP_TEXT;

apps/apps.c:2837:9: Taking false branch
2835.           goto err;
2836.       bflags = BIO_CLOSE;
2837.       if (textmode)
                ^
2838.           bflags |= BIO_FP_TEXT;
2839.       b = BIO_new_fp(fp, bflags);

apps/apps.c:2839:5: Skipping BIO_new_fp(): empty list of specs
2837.       if (textmode)
2838.           bflags |= BIO_FP_TEXT;
2839.       b = BIO_new_fp(fp, bflags);
            ^
2840.       if (b)
2841.           return b;

apps/apps.c:2840:9: Taking true branch
2838.           bflags |= BIO_FP_TEXT;
2839.       b = BIO_new_fp(fp, bflags);
2840.       if (b)
                ^
2841.           return b;
2842.   

apps/apps.c:2841:9: 
2839.       b = BIO_new_fp(fp, bflags);
2840.       if (b)
2841. >         return b;
2842.   
2843.    err:
