crypto/evp/p_verify.c:38: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 30, column 31 is not reachable after line 38, column 9.
Showing all 65 steps of the trace


crypto/evp/p_verify.c:17:1: start of procedure EVP_VerifyFinal()
15.   #include "internal/evp_int.h"
16.   
17. > int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
18.                       unsigned int siglen, EVP_PKEY *pkey)
19.   {

crypto/evp/p_verify.c:21:5: 
19.   {
20.       unsigned char m[EVP_MAX_MD_SIZE];
21. >     unsigned int m_len = 0;
22.       int i = 0;
23.       EVP_PKEY_CTX *pkctx = NULL;

crypto/evp/p_verify.c:22:5: 
20.       unsigned char m[EVP_MAX_MD_SIZE];
21.       unsigned int m_len = 0;
22. >     int i = 0;
23.       EVP_PKEY_CTX *pkctx = NULL;
24.   

crypto/evp/p_verify.c:23:5: 
21.       unsigned int m_len = 0;
22.       int i = 0;
23. >     EVP_PKEY_CTX *pkctx = NULL;
24.   
25.       if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_FINALISE)) {

crypto/evp/p_verify.c:25:9: 
23.       EVP_PKEY_CTX *pkctx = NULL;
24.   
25. >     if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_FINALISE)) {
26.           if (!EVP_DigestFinal_ex(ctx, m, &m_len))
27.               goto err;

crypto/evp/evp_lib.c:479:1: start of procedure EVP_MD_CTX_test_flags()
  477.   }
  478.   
  479. > int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags)
  480.   {
  481.       return (ctx->flags & flags);

crypto/evp/evp_lib.c:481:5: 
  479.   int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags)
  480.   {
  481. >     return (ctx->flags & flags);
  482.   }
  483.   

crypto/evp/evp_lib.c:482:1: return from a call to EVP_MD_CTX_test_flags
  480.   {
  481.       return (ctx->flags & flags);
  482. > }
  483.   
  484.   void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags)

crypto/evp/p_verify.c:25:9: Taking false branch
23.       EVP_PKEY_CTX *pkctx = NULL;
24.   
25.       if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_FINALISE)) {
              ^
26.           if (!EVP_DigestFinal_ex(ctx, m, &m_len))
27.               goto err;

crypto/evp/p_verify.c:29:9: 
27.               goto err;
28.       } else {
29. >         int rv = 0;
30.           EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
31.           if (tmp_ctx == NULL) {

crypto/evp/p_verify.c:30:9: 
28.       } else {
29.           int rv = 0;
30. >         EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
31.           if (tmp_ctx == NULL) {
32.               EVPerr(EVP_F_EVP_VERIFYFINAL, ERR_R_MALLOC_FAILURE);

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:185:1: start of procedure CRYPTO_zalloc()
    183.   }
    184.   
    185. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    186.   {
    187.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:187:5: 
    185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    186.   {
    187. >     void *ret = CRYPTO_malloc(num, file, line);
    188.   
    189.       FAILTEST();

crypto/mem.c:157:1: start of procedure CRYPTO_malloc()
      155.   #endif
      156.   
      157. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      158.   {
      159.       void *ret = NULL;

crypto/mem.c:159:5: 
      157.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      158.   {
      159. >     void *ret = NULL;
      160.   
      161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:161:9: Taking false branch
      159.       void *ret = NULL;
      160.   
      161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      162.           return malloc_impl(num, file, line);
      163.   

crypto/mem.c:164:9: Taking false branch
      162.           return malloc_impl(num, file, line);
      163.   
      164.       if (num <= 0)
                     ^
      165.           return NULL;
      166.   

crypto/mem.c:168:5: 
      166.   
      167.       FAILTEST();
      168. >     allow_customize = 0;
      169.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      170.       if (call_malloc_debug) {

crypto/mem.c:178:5: 
      176.       }
      177.   #else
      178. >     osslargused(file); osslargused(line);
      179.       ret = malloc(num);
      180.   #endif

crypto/mem.c:178:24: 
      176.       }
      177.   #else
      178. >     osslargused(file); osslargused(line);
      179.       ret = malloc(num);
      180.   #endif

crypto/mem.c:179:5: 
      177.   #else
      178.       osslargused(file); osslargused(line);
      179. >     ret = malloc(num);
      180.   #endif
      181.   

crypto/mem.c:182:5: 
      180.   #endif
      181.   
      182. >     return ret;
      183.   }
      184.   

crypto/mem.c:183:1: return from a call to CRYPTO_malloc
      181.   
      182.       return ret;
      183. > }
      184.   
      185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:190:9: Taking true branch
    188.   
    189.       FAILTEST();
    190.       if (ret != NULL)
                   ^
    191.           memset(ret, 0, num);
    192.       return ret;

crypto/mem.c:191:9: 
    189.       FAILTEST();
    190.       if (ret != NULL)
    191. >         memset(ret, 0, num);
    192.       return ret;
    193.   }

crypto/mem.c:192:5: 
    190.       if (ret != NULL)
    191.           memset(ret, 0, num);
    192. >     return ret;
    193.   }
    194.   

crypto/mem.c:193:1: return from a call to CRYPTO_zalloc
    191.           memset(ret, 0, num);
    192.       return ret;
    193. > }
    194.   
    195.   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/evp/p_verify.c:31:13: Taking false branch
29.           int rv = 0;
30.           EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
31.           if (tmp_ctx == NULL) {
                  ^
32.               EVPerr(EVP_F_EVP_VERIFYFINAL, ERR_R_MALLOC_FAILURE);
33.               return 0;

crypto/evp/p_verify.c:35:9: 
33.               return 0;
34.           }
35. >         rv = EVP_MD_CTX_copy_ex(tmp_ctx, ctx);
36.           if (rv)
37.               rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len);

crypto/evp/digest.c:183:1: start of procedure EVP_MD_CTX_copy_ex()
  181.   }
  182.   
  183. > int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  184.   {
  185.       unsigned char *tmp_buf;

crypto/evp/digest.c:186:10: Taking false branch
  184.   {
  185.       unsigned char *tmp_buf;
  186.       if ((in == NULL) || (in->digest == NULL)) {
                  ^
  187.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  188.           return 0;

crypto/evp/digest.c:186:26: Taking false branch
  184.   {
  185.       unsigned char *tmp_buf;
  186.       if ((in == NULL) || (in->digest == NULL)) {
                                  ^
  187.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  188.           return 0;

crypto/evp/digest.c:192:9: Taking true branch
  190.   #ifndef OPENSSL_NO_ENGINE
  191.       /* Make sure it's safe to copy a digest context using an ENGINE */
  192.       if (in->engine && !ENGINE_init(in->engine)) {
                 ^
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  194.           return 0;

crypto/evp/digest.c:192:24: 
  190.   #ifndef OPENSSL_NO_ENGINE
  191.       /* Make sure it's safe to copy a digest context using an ENGINE */
  192. >     if (in->engine && !ENGINE_init(in->engine)) {
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  194.           return 0;

crypto/engine/eng_init.c:76:1: start of procedure ENGINE_init()
    74.   
    75.   /* The API (locked) version of "init" */
    76. > int ENGINE_init(ENGINE *e)
    77.   {
    78.       int ret;

crypto/engine/eng_init.c:79:9: Taking false branch
    77.   {
    78.       int ret;
    79.       if (e == NULL) {
                  ^
    80.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_PASSED_NULL_PARAMETER);
    81.           return 0;

crypto/engine/eng_init.c:83:10: 
    81.           return 0;
    82.       }
    83. >     if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
    85.           return 0;

crypto/threads_pthread.c:63:1: start of procedure CRYPTO_THREAD_run_once()
      61.   }
      62.   
      63. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
      64.   {
      65.       if (pthread_once(once, init) != 0)

crypto/threads_pthread.c:65:9: Taking true branch
      63.   int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
      64.   {
      65.       if (pthread_once(once, init) != 0)
                    ^
      66.           return 0;
      67.   

crypto/threads_pthread.c:66:9: 
      64.   {
      65.       if (pthread_once(once, init) != 0)
      66. >         return 0;
      67.   
      68.       return 1;

crypto/threads_pthread.c:69:1: return from a call to CRYPTO_THREAD_run_once
      67.   
      68.       return 1;
      69. > }
      70.   
      71.   int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))

crypto/engine/eng_init.c:83:10: Condition is false
    81.           return 0;
    82.       }
    83.       if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
                   ^
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
    85.           return 0;

crypto/engine/eng_init.c:83:10: Taking true branch
    81.           return 0;
    82.       }
    83.       if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
                   ^
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
    85.           return 0;

crypto/engine/eng_init.c:84:9: Skipping ERR_put_error(): empty list of specs
    82.       }
    83.       if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
                  ^
    85.           return 0;
    86.       }

crypto/engine/eng_init.c:85:9: 
    83.       if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
    84.           ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE);
    85. >         return 0;
    86.       }
    87.       CRYPTO_THREAD_write_lock(global_engine_lock);

crypto/engine/eng_init.c:91:1: return from a call to ENGINE_init
    89.       CRYPTO_THREAD_unlock(global_engine_lock);
    90.       return ret;
    91. > }
    92.   
    93.   /* The API (locked) version of "finish" */

crypto/evp/digest.c:192:24: Taking true branch
  190.   #ifndef OPENSSL_NO_ENGINE
  191.       /* Make sure it's safe to copy a digest context using an ENGINE */
  192.       if (in->engine && !ENGINE_init(in->engine)) {
                                ^
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  194.           return 0;

crypto/evp/digest.c:193:9: Skipping ERR_put_error(): empty list of specs
  191.       /* Make sure it's safe to copy a digest context using an ENGINE */
  192.       if (in->engine && !ENGINE_init(in->engine)) {
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
                 ^
  194.           return 0;
  195.       }

crypto/evp/digest.c:194:9: 
  192.       if (in->engine && !ENGINE_init(in->engine)) {
  193.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  194. >         return 0;
  195.       }
  196.   #endif

crypto/evp/digest.c:240:1: return from a call to EVP_MD_CTX_copy_ex
  238.   
  239.       return 1;
  240. > }
  241.   
  242.   int EVP_Digest(const void *data, size_t count,

crypto/evp/p_verify.c:36:13: Taking false branch
34.           }
35.           rv = EVP_MD_CTX_copy_ex(tmp_ctx, ctx);
36.           if (rv)
                  ^
37.               rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len);
38.           EVP_MD_CTX_free(tmp_ctx);

crypto/evp/p_verify.c:38:9: 
36.           if (rv)
37.               rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len);
38. >         EVP_MD_CTX_free(tmp_ctx);
39.           if (!rv)
40.               return 0;

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:252:1: start of procedure CRYPTO_free()
    250.   }
    251.   
    252. > void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:254:9: Taking true branch
    252.   void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    255.           free_impl(str, file, line);
    256.           return;

crypto/mem.c:254:30: Taking true branch
    252.   void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    255.           free_impl(str, file, line);
    256.           return;

crypto/mem.c:255:9: Skipping __function_pointer__(): unresolved function pointer
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    255.           free_impl(str, file, line);
                   ^
    256.           return;
    257.       }

crypto/mem.c:256:9: 
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    255.           free_impl(str, file, line);
    256. >         return;
    257.       }
    258.   

crypto/mem.c:270:1: return from a call to CRYPTO_free
    268.       free(str);
    269.   #endif
    270. > }
    271.   
    272.   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)
