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


apps/apps.c:2425:1: start of procedure bio_open_owner()
2423.    * Open a file for writing, owner-read-only.
2424.    */
2425. > BIO *bio_open_owner(const char *filename, int format, int private)
2426.   {
2427.       FILE *fp = NULL;

apps/apps.c:2427:5: 
2425.   BIO *bio_open_owner(const char *filename, int format, int private)
2426.   {
2427. >     FILE *fp = NULL;
2428.       BIO *b = NULL;
2429.       int fd = -1, bflags, mode, textmode;

apps/apps.c:2428:5: 
2426.   {
2427.       FILE *fp = NULL;
2428. >     BIO *b = NULL;
2429.       int fd = -1, bflags, mode, textmode;
2430.   

apps/apps.c:2429:5: 
2427.       FILE *fp = NULL;
2428.       BIO *b = NULL;
2429. >     int fd = -1, bflags, mode, textmode;
2430.   
2431.       if (!private || filename == NULL || strcmp(filename, "-") == 0)

apps/apps.c:2431:10: Taking false branch
2429.       int fd = -1, bflags, mode, textmode;
2430.   
2431.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                 ^
2432.           return bio_open_default(filename, 'w', format);
2433.   

apps/apps.c:2431:21: Taking false branch
2429.       int fd = -1, bflags, mode, textmode;
2430.   
2431.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                            ^
2432.           return bio_open_default(filename, 'w', format);
2433.   

apps/apps.c:2431:41: Taking false branch
2429.       int fd = -1, bflags, mode, textmode;
2430.   
2431.       if (!private || filename == NULL || strcmp(filename, "-") == 0)
                                                ^
2432.           return bio_open_default(filename, 'w', format);
2433.   

apps/apps.c:2434:5: 
2432.           return bio_open_default(filename, 'w', format);
2433.   
2434. >     mode = O_WRONLY;
2435.   #ifdef O_CREAT
2436.       mode |= O_CREAT;

apps/apps.c:2436:5: 
2434.       mode = O_WRONLY;
2435.   #ifdef O_CREAT
2436. >     mode |= O_CREAT;
2437.   #endif
2438.   #ifdef O_TRUNC

apps/apps.c:2439:5: 
2437.   #endif
2438.   #ifdef O_TRUNC
2439. >     mode |= O_TRUNC;
2440.   #endif
2441.       textmode = istext(format);

apps/apps.c:2441:5: 
2439.       mode |= O_TRUNC;
2440.   #endif
2441. >     textmode = istext(format);
2442.       if (!textmode) {
2443.   #ifdef O_BINARY

apps/apps.c:2341:1: start of procedure istext()
  2339.    * text and binary input/output on non-Unix platforms
  2340.    */
  2341. > static int istext(int format)
  2342.   {
  2343.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;

apps/apps.c:2343:12: Condition is true
  2341.   static int istext(int format)
  2342.   {
  2343.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
                     ^
  2344.   }
  2345.   

apps/apps.c:2343:5: 
  2341.   static int istext(int format)
  2342.   {
  2343. >     return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2344.   }
  2345.   

apps/apps.c:2344:1: return from a call to istext
  2342.   {
  2343.       return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
  2344. > }
  2345.   
  2346.   BIO *dup_bio_in(int format)

apps/apps.c:2442:10: Taking false branch
2440.   #endif
2441.       textmode = istext(format);
2442.       if (!textmode) {
                 ^
2443.   #ifdef O_BINARY
2444.           mode |= O_BINARY;

apps/apps.c:2460:9: 
2458.       else
2459.   #endif
2460. >         fd = open(filename, mode, 0600);
2461.       if (fd < 0)
2462.           goto err;

apps/apps.c:2461:9: Taking false branch
2459.   #endif
2460.           fd = open(filename, mode, 0600);
2461.       if (fd < 0)
                ^
2462.           goto err;
2463.       fp = fdopen(fd, modestr('w', format));

apps/apps.c:2463:5: 
2461.       if (fd < 0)
2462.           goto err;
2463. >     fp = fdopen(fd, modestr('w', format));
2464.       if (fp == NULL)
2465.           goto err;

apps/apps.c:2393:1: start of procedure modestr()
  2391.   }
  2392.   
  2393. > static const char *modestr(char mode, int format)
  2394.   {
  2395.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');

apps/apps.c:2395:5: Condition is true
  2393.   static const char *modestr(char mode, int format)
  2394.   {
  2395.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
              ^
  2396.   
  2397.       switch (mode) {

apps/apps.c:2397:5: 
  2395.       OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
  2396.   
  2397. >     switch (mode) {
  2398.       case 'a':
  2399.           return istext(format) ? "a" : "ab";

apps/apps.c:2398:5: Switch condition is false. Skipping switch case
  2396.   
  2397.       switch (mode) {
  2398.       case 'a':
              ^
  2399.           return istext(format) ? "a" : "ab";
  2400.       case 'r':

apps/apps.c:2400:5: Switch condition is false. Skipping switch case
  2398.       case 'a':
  2399.           return istext(format) ? "a" : "ab";
  2400.       case 'r':
              ^
  2401.           return istext(format) ? "r" : "rb";
  2402.       case 'w':

apps/apps.c:2402:5: Switch condition is false. Skipping switch case
  2400.       case 'r':
  2401.           return istext(format) ? "r" : "rb";
  2402.       case 'w':
              ^
  2403.           return istext(format) ? "w" : "wb";
  2404.       }

apps/apps.c:2406:5: 
  2404.       }
  2405.       /* The assert above should make sure we never reach this point */
  2406. >     return NULL;
  2407.   }
  2408.   

apps/apps.c:2407:1: return from a call to modestr
  2405.       /* The assert above should make sure we never reach this point */
  2406.       return NULL;
  2407. > }
  2408.   
  2409.   static const char *modeverb(char mode)

apps/apps.c:2464:9: Taking false branch
2462.           goto err;
2463.       fp = fdopen(fd, modestr('w', format));
2464.       if (fp == NULL)
                ^
2465.           goto err;
2466.       bflags = BIO_CLOSE;

apps/apps.c:2466:5: 
2464.       if (fp == NULL)
2465.           goto err;
2466. >     bflags = BIO_CLOSE;
2467.       if (textmode)
2468.           bflags |= BIO_FP_TEXT;

apps/apps.c:2467:9: Taking false branch
2465.           goto err;
2466.       bflags = BIO_CLOSE;
2467.       if (textmode)
                ^
2468.           bflags |= BIO_FP_TEXT;
2469.       b = BIO_new_fp(fp, bflags);

apps/apps.c:2469:5: Skipping BIO_new_fp(): empty list of specs
2467.       if (textmode)
2468.           bflags |= BIO_FP_TEXT;
2469.       b = BIO_new_fp(fp, bflags);
            ^
2470.       if (b)
2471.           return b;

apps/apps.c:2470:9: Taking true branch
2468.           bflags |= BIO_FP_TEXT;
2469.       b = BIO_new_fp(fp, bflags);
2470.       if (b)
                ^
2471.           return b;
2472.   

apps/apps.c:2471:9: 
2469.       b = BIO_new_fp(fp, bflags);
2470.       if (b)
2471. >         return b;
2472.   
2473.    err:
