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


apps/apps.c:2787:1: start of procedure bio_open_owner()
2785.    * Open a file for writing, owner-read-only.
2786.    */
2787. > BIO *bio_open_owner(const char *filename, int format, int private)
2788.   {
2789.       FILE *fp = NULL;

apps/apps.c:2789:5: 
2787.   BIO *bio_open_owner(const char *filename, int format, int private)
2788.   {
2789. >     FILE *fp = NULL;
2790.       BIO *b = NULL;
2791.       int fd = -1, bflags, mode, binmode;

apps/apps.c:2790:5: 
2788.   {
2789.       FILE *fp = NULL;
2790. >     BIO *b = NULL;
2791.       int fd = -1, bflags, mode, binmode;
2792.   

apps/apps.c:2791:5: 
2789.       FILE *fp = NULL;
2790.       BIO *b = NULL;
2791. >     int fd = -1, bflags, mode, binmode;
2792.   
2793.       if (!private || filename == NULL || strcmp(filename, "-") == 0)

apps/apps.c:2793:10: Taking false branch
2791.       int fd = -1, bflags, mode, binmode;
2792.   
2793.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                 ^
2794.           return bio_open_default(filename, 'w', format);
2795.   

apps/apps.c:2793:21: Taking false branch
2791.       int fd = -1, bflags, mode, binmode;
2792.   
2793.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                            ^
2794.           return bio_open_default(filename, 'w', format);
2795.   

apps/apps.c:2793:41: Taking false branch
2791.       int fd = -1, bflags, mode, binmode;
2792.   
2793.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                                                ^
2794.           return bio_open_default(filename, 'w', format);
2795.   

apps/apps.c:2796:5: 
2794.           return bio_open_default(filename, 'w', format);
2795.   
2796. >     mode = O_WRONLY;
2797.   #ifdef O_CREAT
2798.       mode |= O_CREAT;

apps/apps.c:2798:5: 
2796.       mode = O_WRONLY;
2797.   #ifdef O_CREAT
2798. >     mode |= O_CREAT;
2799.   #endif
2800.   #ifdef O_TRUNC

apps/apps.c:2801:5: 
2799.   #endif
2800.   #ifdef O_TRUNC
2801. >     mode |= O_TRUNC;
2802.   #endif
2803.       binmode = istext(format);

apps/apps.c:2803:5: 
2801.       mode |= O_TRUNC;
2802.   #endif
2803. >     binmode = istext(format);
2804.       if (binmode) {
2805.   #ifdef O_BINARY

apps/apps.c:2728:1: start of procedure istext()
  2726.    * text and binary input/output on non-Unix platforms
  2727.    */
  2728. > static int istext(int format)
  2729.   {
  2730.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;

apps/apps.c:2730:12: Condition is true
  2728.   static int istext(int format)
  2729.   {
  2730.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
                     ^
  2731.   }
  2732.   

apps/apps.c:2730:5: 
  2728.   static int istext(int format)
  2729.   {
  2730. >     return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2731.   }
  2732.   

apps/apps.c:2731:1: return from a call to istext
  2729.   {
  2730.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2731. > }
  2732.   
  2733.   BIO *dup_bio_in(int format)

apps/apps.c:2804:9: Taking true branch
2802.   #endif
2803.       binmode = istext(format);
2804.       if (binmode) {
                ^
2805.   #ifdef O_BINARY
2806.           mode |= O_BINARY;

apps/apps.c:2812:5: 
2810.       }
2811.   
2812. >     fd = open(filename, mode, 0600);
2813.       if (fd < 0)
2814.           goto err;

apps/apps.c:2813:9: Taking false branch
2811.   
2812.       fd = open(filename, mode, 0600);
2813.       if (fd < 0)
                ^
2814.           goto err;
2815.       fp = fdopen(fd, modestr('w', format));

apps/apps.c:2815:5: 
2813.       if (fd < 0)
2814.           goto err;
2815. >     fp = fdopen(fd, modestr('w', format));
2816.       if (fp == NULL)
2817.           goto err;

apps/apps.c:2755:1: start of procedure modestr()
  2753.   }
  2754.   
  2755. > static const char *modestr(char mode, int format)
  2756.   {
  2757.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');

apps/apps.c:2757:5: Condition is true
  2755.   static const char *modestr(char mode, int format)
  2756.   {
  2757.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
              ^
  2758.   
  2759.       switch (mode) {

apps/apps.c:2759:5: 
  2757.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
  2758.   
  2759. >     switch (mode) {
  2760.       case 'a':
  2761.           return istext(format) ? "a" : "ab";

apps/apps.c:2760:5: Switch condition is false. Skipping switch case
  2758.   
  2759.       switch (mode) {
  2760.       case 'a':
              ^
  2761.           return istext(format) ? "a" : "ab";
  2762.       case 'r':

apps/apps.c:2762:5: Switch condition is false. Skipping switch case
  2760.       case 'a':
  2761.           return istext(format) ? "a" : "ab";
  2762.       case 'r':
              ^
  2763.           return istext(format) ? "r" : "rb";
  2764.       case 'w':

apps/apps.c:2764:5: Switch condition is false. Skipping switch case
  2762.       case 'r':
  2763.           return istext(format) ? "r" : "rb";
  2764.       case 'w':
              ^
  2765.           return istext(format) ? "w" : "wb";
  2766.       }

apps/apps.c:2768:5: 
  2766.       }
  2767.       /* The assert above should make sure we never reach this point */
  2768. >     return NULL;
  2769.   }
  2770.   

apps/apps.c:2769:1: return from a call to modestr
  2767.       /* The assert above should make sure we never reach this point */
  2768.       return NULL;
  2769. > }
  2770.   
  2771.   static const char *modeverb(char mode)

apps/apps.c:2816:9: Taking false branch
2814.           goto err;
2815.       fp = fdopen(fd, modestr('w', format));
2816.       if (fp == NULL)
                ^
2817.           goto err;
2818.       bflags = BIO_CLOSE;

apps/apps.c:2818:5: 
2816.       if (fp == NULL)
2817.           goto err;
2818. >     bflags = BIO_CLOSE;
2819.       if (!binmode)
2820.           bflags |= BIO_FP_TEXT;

apps/apps.c:2819:10: Taking false branch
2817.           goto err;
2818.       bflags = BIO_CLOSE;
2819.       if (!binmode)
                 ^
2820.           bflags |= BIO_FP_TEXT;
2821.       b = BIO_new_fp(fp, bflags);

apps/apps.c:2821:5: Skipping BIO_new_fp(): empty list of specs
2819.       if (!binmode)
2820.           bflags |= BIO_FP_TEXT;
2821.       b = BIO_new_fp(fp, bflags);
            ^
2822.       if (b)
2823.           return b;

apps/apps.c:2822:9: Taking true branch
2820.           bflags |= BIO_FP_TEXT;
2821.       b = BIO_new_fp(fp, bflags);
2822.       if (b)
                ^
2823.           return b;
2824.   

apps/apps.c:2823:9: 
2821.       b = BIO_new_fp(fp, bflags);
2822.       if (b)
2823. >         return b;
2824.   
2825.    err:
