crypto/pem/pvkfmt.c:656: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 647, column 24 is not reachable after line 656, column 5.
Showing all 45 steps of the trace


crypto/pem/pvkfmt.c:643:1: start of procedure derive_pvk_key()
641.   }
642.   
643. > static int derive_pvk_key(unsigned char *key,
644.                             const unsigned char *salt, unsigned int saltlen,
645.                             const unsigned char *pass, int passlen)

crypto/pem/pvkfmt.c:647:5: 
645.                             const unsigned char *pass, int passlen)
646.   {
647. >     EVP_MD_CTX *mctx = EVP_MD_CTX_new();
648.       int rv = 1;
649.       if (mctx == NULL

crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
  42.   }
  43.   
  44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:46:5: 
  44.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  45.   {
  46. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47.   }
  48.   

crypto/mem.c:218:1: start of procedure CRYPTO_zalloc()
    216.   }
    217.   
    218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    219.   {
    220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
    218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    219.   {
    220. >     void *ret = CRYPTO_malloc(num, file, line);
    221.   
    222.       FAILTEST();

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
      187.   #endif
      188.   
      189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      190.   {
      191.       void *ret = NULL;

crypto/mem.c:191:5: 
      189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      190.   {
      191. >     void *ret = NULL;
      192.   
      193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking false branch
      192.   
      193.       INCREMENT(malloc_count);
      194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      195.           return malloc_impl(num, file, line);
      196.   

crypto/mem.c:197:9: Taking false branch
      195.           return malloc_impl(num, file, line);
      196.   
      197.       if (num == 0)
                     ^
      198.           return NULL;
      199.   

crypto/mem.c:201:5: 
      199.   
      200.       FAILTEST();
      201. >     allow_customize = 0;
      202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      203.       if (call_malloc_debug) {

crypto/mem.c:211:5: 
      209.       }
      210.   #else
      211. >     (void)(file); (void)(line);
      212.       ret = malloc(num);
      213.   #endif

crypto/mem.c:211:19: 
      209.       }
      210.   #else
      211. >     (void)(file); (void)(line);
      212.       ret = malloc(num);
      213.   #endif

crypto/mem.c:212:5: 
      210.   #else
      211.       (void)(file); (void)(line);
      212. >     ret = malloc(num);
      213.   #endif
      214.   

crypto/mem.c:215:5: 
      213.   #endif
      214.   
      215. >     return ret;
      216.   }
      217.   

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
      214.   
      215.       return ret;
      216. > }
      217.   
      218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:223:9: Taking true branch
    221.   
    222.       FAILTEST();
    223.       if (ret != NULL)
                   ^
    224.           memset(ret, 0, num);
    225.       return ret;

crypto/mem.c:224:9: 
    222.       FAILTEST();
    223.       if (ret != NULL)
    224. >         memset(ret, 0, num);
    225.       return ret;
    226.   }

crypto/mem.c:225:5: 
    223.       if (ret != NULL)
    224.           memset(ret, 0, num);
    225. >     return ret;
    226.   }
    227.   

crypto/mem.c:226:1: return from a call to CRYPTO_zalloc
    224.           memset(ret, 0, num);
    225.       return ret;
    226. > }
    227.   
    228.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
  45.   {
  46.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  47. > }
  48.   
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/pem/pvkfmt.c:648:5: 
646.   {
647.       EVP_MD_CTX *mctx = EVP_MD_CTX_new();
648. >     int rv = 1;
649.       if (mctx == NULL
650.           || !EVP_DigestInit_ex(mctx, EVP_sha1(), NULL)

crypto/pem/pvkfmt.c:649:9: Taking false branch
647.       EVP_MD_CTX *mctx = EVP_MD_CTX_new();
648.       int rv = 1;
649.       if (mctx == NULL
               ^
650.           || !EVP_DigestInit_ex(mctx, EVP_sha1(), NULL)
651.           || !EVP_DigestUpdate(mctx, salt, saltlen)

crypto/pem/pvkfmt.c:650:13: 
648.       int rv = 1;
649.       if (mctx == NULL
650. >         || !EVP_DigestInit_ex(mctx, EVP_sha1(), NULL)
651.           || !EVP_DigestUpdate(mctx, salt, saltlen)
652.           || !EVP_DigestUpdate(mctx, pass, passlen)

crypto/evp/m_sha1.c:108:1: start of procedure EVP_sha1()
  106.   };
  107.   
  108. > const EVP_MD *EVP_sha1(void)
  109.   {
  110.       return &sha1_md;

crypto/evp/m_sha1.c:110:5: 
  108.   const EVP_MD *EVP_sha1(void)
  109.   {
  110. >     return &sha1_md;
  111.   }
  112.   

crypto/evp/m_sha1.c:111:1: return from a call to EVP_sha1
  109.   {
  110.       return &sha1_md;
  111. > }
  112.   
  113.   static int init224(EVP_MD_CTX *ctx)

crypto/pem/pvkfmt.c:650:13: Taking false branch
648.       int rv = 1;
649.       if (mctx == NULL
650.           || !EVP_DigestInit_ex(mctx, EVP_sha1(), NULL)
                   ^
651.           || !EVP_DigestUpdate(mctx, salt, saltlen)
652.           || !EVP_DigestUpdate(mctx, pass, passlen)

crypto/pem/pvkfmt.c:651:13: 
649.       if (mctx == NULL
650.           || !EVP_DigestInit_ex(mctx, EVP_sha1(), NULL)
651. >         || !EVP_DigestUpdate(mctx, salt, saltlen)
652.           || !EVP_DigestUpdate(mctx, pass, passlen)
653.           || !EVP_DigestFinal_ex(mctx, key, NULL))

crypto/evp/digest.c:146:1: start of procedure EVP_DigestUpdate()
  144.   }
  145.   
  146. > int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  147.   {
  148.       return ctx->update(ctx, data, count);

crypto/evp/digest.c:148:5: Skipping __function_pointer__(): unresolved function pointer
  146.   int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
  147.   {
  148.       return ctx->update(ctx, data, count);
             ^
  149.   }
  150.   

crypto/evp/digest.c:149:1: return from a call to EVP_DigestUpdate
  147.   {
  148.       return ctx->update(ctx, data, count);
  149. > }
  150.   
  151.   /* The caller can assume that this removes any secret data from the context */

crypto/pem/pvkfmt.c:651:13: Taking true branch
649.       if (mctx == NULL
650.           || !EVP_DigestInit_ex(mctx, EVP_sha1(), NULL)
651.           || !EVP_DigestUpdate(mctx, salt, saltlen)
                   ^
652.           || !EVP_DigestUpdate(mctx, pass, passlen)
653.           || !EVP_DigestFinal_ex(mctx, key, NULL))

crypto/pem/pvkfmt.c:654:9: 
652.           || !EVP_DigestUpdate(mctx, pass, passlen)
653.           || !EVP_DigestFinal_ex(mctx, key, NULL))
654. >         rv = 0;
655.   
656.       EVP_MD_CTX_free(mctx);

crypto/pem/pvkfmt.c:656:5: 
654.           rv = 0;
655.   
656. >     EVP_MD_CTX_free(mctx);
657.       return rv;
658.   }

crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
  47.   }
  48.   
  49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  49.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
            ^
  52.       OPENSSL_free(ctx);
  53.   }

crypto/evp/digest.c:52:5: 
  50.   {
  51.       EVP_MD_CTX_reset(ctx);
  52. >     OPENSSL_free(ctx);
  53.   }
  54.   

crypto/mem.c:286:1: start of procedure CRYPTO_free()
    284.   }
    285.   
    286. > void CRYPTO_free(void *str, const char *file, int line)
    287.   {
    288.       INCREMENT(free_count);

crypto/mem.c:289:9: Taking true branch
    287.   {
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    290.           free_impl(str, file, line);
    291.           return;

crypto/mem.c:289:30: Taking true branch
    287.   {
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    290.           free_impl(str, file, line);
    291.           return;

crypto/mem.c:290:9: Skipping __function_pointer__(): unresolved function pointer
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    290.           free_impl(str, file, line);
                   ^
    291.           return;
    292.       }

crypto/mem.c:291:9: 
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    290.           free_impl(str, file, line);
    291. >         return;
    292.       }
    293.   

crypto/mem.c:305:1: return from a call to CRYPTO_free
    303.       free(str);
    304.   #endif
    305. > }
    306.   
    307.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
  51.       EVP_MD_CTX_reset(ctx);
  52.       OPENSSL_free(ctx);
  53. > }
  54.   
  55.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
