crypto/evp/m_sigver.c:188: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 184, column 31 is not reachable after line 188, column 13.
Showing all 62 steps of the trace


crypto/evp/m_sigver.c:166:1: start of procedure EVP_DigestVerifyFinal()
164.   }
165.   
166. > int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
167.                             size_t siglen)
168.   {

crypto/evp/m_sigver.c:170:5: 
168.   {
169.       unsigned char md[EVP_MAX_MD_SIZE];
170. >     int r = 0;
171.       unsigned int mdlen = 0;
172.       int vctx = 0;

crypto/evp/m_sigver.c:171:5: 
169.       unsigned char md[EVP_MAX_MD_SIZE];
170.       int r = 0;
171. >     unsigned int mdlen = 0;
172.       int vctx = 0;
173.   

crypto/evp/m_sigver.c:172:5: 
170.       int r = 0;
171.       unsigned int mdlen = 0;
172. >     int vctx = 0;
173.   
174.       if (ctx->pctx->pmeth->verifyctx)

crypto/evp/m_sigver.c:174:9: Taking true branch
172.       int vctx = 0;
173.   
174.       if (ctx->pctx->pmeth->verifyctx)
               ^
175.           vctx = 1;
176.       else

crypto/evp/m_sigver.c:175:9: 
173.   
174.       if (ctx->pctx->pmeth->verifyctx)
175. >         vctx = 1;
176.       else
177.           vctx = 0;

crypto/evp/m_sigver.c:178:9: Taking false branch
176.       else
177.           vctx = 0;
178.       if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {
               ^
179.           if (vctx) {
180.               r = ctx->pctx->pmeth->verifyctx(ctx->pctx, sig, siglen, ctx);

crypto/evp/m_sigver.c:184:9: 
182.               r = EVP_DigestFinal_ex(ctx, md, &mdlen);
183.       } else {
184. >         EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
185.           if (tmp_ctx == NULL)
186.               return -1;

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/evp/m_sigver.c:185:13: Taking false branch
183.       } else {
184.           EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
185.           if (tmp_ctx == NULL)
                   ^
186.               return -1;
187.           if (!EVP_MD_CTX_copy_ex(tmp_ctx, ctx)) {

crypto/evp/m_sigver.c:187:14: 
185.           if (tmp_ctx == NULL)
186.               return -1;
187. >         if (!EVP_MD_CTX_copy_ex(tmp_ctx, ctx)) {
188.               EVP_MD_CTX_free(tmp_ctx);
189.               return -1;

crypto/evp/digest.c:204:1: start of procedure EVP_MD_CTX_copy_ex()
  202.   }
  203.   
  204. > int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  205.   {
  206.       unsigned char *tmp_buf;

crypto/evp/digest.c:207:10: Taking false branch
  205.   {
  206.       unsigned char *tmp_buf;
  207.       if ((in == NULL) || (in->digest == NULL)) {
                  ^
  208.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  209.           return 0;

crypto/evp/digest.c:207:26: Taking false branch
  205.   {
  206.       unsigned char *tmp_buf;
  207.       if ((in == NULL) || (in->digest == NULL)) {
                                  ^
  208.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  209.           return 0;

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

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

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

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

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

crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once()
      103.   }
      104.   
      105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
      106.   {
      107.       if (pthread_once(once, init) != 0)

crypto/threads_pthread.c:107:9: Taking true branch
      105.   int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
      106.   {
      107.       if (pthread_once(once, init) != 0)
                     ^
      108.           return 0;
      109.   

crypto/threads_pthread.c:108:9: 
      106.   {
      107.       if (pthread_once(once, init) != 0)
      108. >         return 0;
      109.   
      110.       return 1;

crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once
      109.   
      110.       return 1;
      111. > }
      112.   
      113.   int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))

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

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

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

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

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

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

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

crypto/evp/digest.c:215:9: 
  213.       if (in->engine && !ENGINE_init(in->engine)) {
  214.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB);
  215. >         return 0;
  216.       }
  217.   #endif

crypto/evp/digest.c:261:1: return from a call to EVP_MD_CTX_copy_ex
  259.   
  260.       return 1;
  261. > }
  262.   
  263.   int EVP_Digest(const void *data, size_t count,

crypto/evp/m_sigver.c:187:14: Taking true branch
185.           if (tmp_ctx == NULL)
186.               return -1;
187.           if (!EVP_MD_CTX_copy_ex(tmp_ctx, ctx)) {
                    ^
188.               EVP_MD_CTX_free(tmp_ctx);
189.               return -1;

crypto/evp/m_sigver.c:188:13: 
186.               return -1;
187.           if (!EVP_MD_CTX_copy_ex(tmp_ctx, ctx)) {
188. >             EVP_MD_CTX_free(tmp_ctx);
189.               return -1;
190.           }

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)
