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


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

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

apps/apps.c:2786:5: 
2784.   {
2785.       FILE *fp = NULL;
2786. >     BIO *b = NULL;
2787.       int fd = -1, bflags, mode, binmode;
2788.   

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

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

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

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

apps/apps.c:2792:5: 
2790.           return bio_open_default(filename, 'w', format);
2791.   
2792. >     mode = O_WRONLY;
2793.   #ifdef O_CREAT
2794.       mode |= O_CREAT;

apps/apps.c:2794:5: 
2792.       mode = O_WRONLY;
2793.   #ifdef O_CREAT
2794. >     mode |= O_CREAT;
2795.   #endif
2796.   #ifdef O_TRUNC

apps/apps.c:2797:5: 
2795.   #endif
2796.   #ifdef O_TRUNC
2797. >     mode |= O_TRUNC;
2798.   #endif
2799.       binmode = istext(format);

apps/apps.c:2799:5: 
2797.       mode |= O_TRUNC;
2798.   #endif
2799. >     binmode = istext(format);
2800.       if (binmode) {
2801.   #ifdef O_BINARY

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

apps/apps.c:2726:12: Condition is true
  2724.   static int istext(int format)
  2725.   {
  2726.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
                     ^
  2727.   }
  2728.   

apps/apps.c:2726:5: 
  2724.   static int istext(int format)
  2725.   {
  2726. >     return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2727.   }
  2728.   

apps/apps.c:2727:1: return from a call to istext
  2725.   {
  2726.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2727. > }
  2728.   
  2729.   BIO *dup_bio_in(int format)

apps/apps.c:2800:9: Taking true branch
2798.   #endif
2799.       binmode = istext(format);
2800.       if (binmode) {
                ^
2801.   #ifdef O_BINARY
2802.           mode |= O_BINARY;

apps/apps.c:2808:5: 
2806.       }
2807.   
2808. >     fd = open(filename, mode, 0600);
2809.       if (fd < 0)
2810.           goto err;

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

apps/apps.c:2811:5: 
2809.       if (fd < 0)
2810.           goto err;
2811. >     fp = fdopen(fd, modestr('w', format));
2812.       if (fp == NULL)
2813.           goto err;

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

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

apps/apps.c:2755:5: 
  2753.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
  2754.   
  2755. >     switch (mode) {
  2756.       case 'a':
  2757.           return istext(format) ? "a" : "ab";

apps/apps.c:2756:5: Switch condition is false. Skipping switch case
  2754.   
  2755.       switch (mode) {
  2756.       case 'a':
              ^
  2757.           return istext(format) ? "a" : "ab";
  2758.       case 'r':

apps/apps.c:2758:5: Switch condition is false. Skipping switch case
  2756.       case 'a':
  2757.           return istext(format) ? "a" : "ab";
  2758.       case 'r':
              ^
  2759.           return istext(format) ? "r" : "rb";
  2760.       case 'w':

apps/apps.c:2760:5: Switch condition is false. Skipping switch case
  2758.       case 'r':
  2759.           return istext(format) ? "r" : "rb";
  2760.       case 'w':
              ^
  2761.           return istext(format) ? "w" : "wb";
  2762.       }

apps/apps.c:2764:5: 
  2762.       }
  2763.       /* The assert above should make sure we never reach this point */
  2764. >     return NULL;
  2765.   }
  2766.   

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

apps/apps.c:2812:9: Taking false branch
2810.           goto err;
2811.       fp = fdopen(fd, modestr('w', format));
2812.       if (fp == NULL)
                ^
2813.           goto err;
2814.       bflags = BIO_CLOSE;

apps/apps.c:2814:5: 
2812.       if (fp == NULL)
2813.           goto err;
2814. >     bflags = BIO_CLOSE;
2815.       if (!binmode)
2816.           bflags |= BIO_FP_TEXT;

apps/apps.c:2815:10: Taking false branch
2813.           goto err;
2814.       bflags = BIO_CLOSE;
2815.       if (!binmode)
                 ^
2816.           bflags |= BIO_FP_TEXT;
2817.       b = BIO_new_fp(fp, bflags);

apps/apps.c:2817:5: Skipping BIO_new_fp(): empty list of specs
2815.       if (!binmode)
2816.           bflags |= BIO_FP_TEXT;
2817.       b = BIO_new_fp(fp, bflags);
            ^
2818.       if (b)
2819.           return b;

apps/apps.c:2818:9: Taking true branch
2816.           bflags |= BIO_FP_TEXT;
2817.       b = BIO_new_fp(fp, bflags);
2818.       if (b)
                ^
2819.           return b;
2820.   

apps/apps.c:2819:9: 
2817.       b = BIO_new_fp(fp, bflags);
2818.       if (b)
2819. >         return b;
2820.   
2821.    err:
