apps/apps.c:2831: error: RESOURCE_LEAK
  resource of type `_IO_FILE` acquired by call to `fdopen()` at line 2823, column 10 is not released after line 2831, 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, binmode;

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

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

apps/apps.c:2801:10: Taking false branch
2799.       int fd = -1, bflags, mode, binmode;
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, binmode;
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, binmode;
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.       binmode = istext(format);

apps/apps.c:2811:5: 
2809.       mode |= O_TRUNC;
2810.   #endif
2811. >     binmode = istext(format);
2812.       if (binmode) {
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:9: Taking true branch
2810.   #endif
2811.       binmode = istext(format);
2812.       if (binmode) {
                ^
2813.   #ifdef O_BINARY
2814.           mode |= O_BINARY;

apps/apps.c:2820:5: 
2818.       }
2819.   
2820. >     fd = open(filename, mode, 0600);
2821.       if (fd < 0)
2822.           goto err;

apps/apps.c:2821:9: Taking false branch
2819.   
2820.       fd = open(filename, mode, 0600);
2821.       if (fd < 0)
                ^
2822.           goto err;
2823.       fp = fdopen(fd, modestr('w', format));

apps/apps.c:2823:5: 
2821.       if (fd < 0)
2822.           goto err;
2823. >     fp = fdopen(fd, modestr('w', format));
2824.       if (fp == NULL)
2825.           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:2824:9: Taking false branch
2822.           goto err;
2823.       fp = fdopen(fd, modestr('w', format));
2824.       if (fp == NULL)
                ^
2825.           goto err;
2826.       bflags = BIO_CLOSE;

apps/apps.c:2826:5: 
2824.       if (fp == NULL)
2825.           goto err;
2826. >     bflags = BIO_CLOSE;
2827.       if (!binmode)
2828.           bflags |= BIO_FP_TEXT;

apps/apps.c:2827:10: Taking false branch
2825.           goto err;
2826.       bflags = BIO_CLOSE;
2827.       if (!binmode)
                 ^
2828.           bflags |= BIO_FP_TEXT;
2829.       b = BIO_new_fp(fp, bflags);

apps/apps.c:2829:5: Skipping BIO_new_fp(): empty list of specs
2827.       if (!binmode)
2828.           bflags |= BIO_FP_TEXT;
2829.       b = BIO_new_fp(fp, bflags);
            ^
2830.       if (b)
2831.           return b;

apps/apps.c:2830:9: Taking true branch
2828.           bflags |= BIO_FP_TEXT;
2829.       b = BIO_new_fp(fp, bflags);
2830.       if (b)
                ^
2831.           return b;
2832.   

apps/apps.c:2831:9: 
2829.       b = BIO_new_fp(fp, bflags);
2830.       if (b)
2831. >         return b;
2832.   
2833.    err:
