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 66 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:197:1: start of procedure CRYPTO_zalloc()
    195.   }
    196.   
    197. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:199:5: 
    197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    198.   {
    199. >     void *ret = CRYPTO_malloc(num, file, line);
    200.   
    201.       FAILTEST();

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
      167.   #endif
      168.   
      169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171.       void *ret = NULL;

crypto/mem.c:171:5: 
      169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      170.   {
      171. >     void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
      171.       void *ret = NULL;
      172.   
      173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      174.           return malloc_impl(num, file, line);
      175.   

crypto/mem.c:176:9: Taking false branch
      174.           return malloc_impl(num, file, line);
      175.   
      176.       if (num == 0)
                     ^
      177.           return NULL;
      178.   

crypto/mem.c:180:5: 
      178.   
      179.       FAILTEST();
      180. >     allow_customize = 0;
      181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
      188.       }
      189.   #else
      190. >     osslargused(file); osslargused(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:190:24: 
      188.       }
      189.   #else
      190. >     osslargused(file); osslargused(line);
      191.       ret = malloc(num);
      192.   #endif

crypto/mem.c:191:5: 
      189.   #else
      190.       osslargused(file); osslargused(line);
      191. >     ret = malloc(num);
      192.   #endif
      193.   

crypto/mem.c:194:5: 
      192.   #endif
      193.   
      194. >     return ret;
      195.   }
      196.   

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
      193.   
      194.       return ret;
      195. > }
      196.   
      197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:202:9: Taking true branch
    200.   
    201.       FAILTEST();
    202.       if (ret != NULL)
                   ^
    203.           memset(ret, 0, num);
    204.       return ret;

crypto/mem.c:203:9: 
    201.       FAILTEST();
    202.       if (ret != NULL)
    203. >         memset(ret, 0, num);
    204.       return ret;
    205.   }

crypto/mem.c:204:5: 
    202.       if (ret != NULL)
    203.           memset(ret, 0, num);
    204. >     return ret;
    205.   }
    206.   

crypto/mem.c:205:1: return from a call to CRYPTO_zalloc
    203.           memset(ret, 0, num);
    204.       return ret;
    205. > }
    206.   
    207.   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 true 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:187:9: 
  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;
  189.       }

crypto/err/err.c:365:1: start of procedure ERR_put_error()
    363.   /********************************************************/
    364.   
    365. > void ERR_put_error(int lib, int func, int reason, const char *file, int line)
    366.   {
    367.       ERR_STATE *es;

crypto/err/err.c:388:5: 
    386.       }
    387.   #endif
    388. >     es = ERR_get_state();
    389.       if (es == NULL)
    390.           return;

crypto/err/err.c:679:1: start of procedure ERR_get_state()
      677.   }
      678.   
      679. > ERR_STATE *ERR_get_state(void)
      680.   {
      681.       ERR_STATE *state = NULL;

crypto/err/err.c:681:5: 
      679.   ERR_STATE *ERR_get_state(void)
      680.   {
      681. >     ERR_STATE *state = NULL;
      682.   
      683.       if (!RUN_ONCE(&err_init, err_do_init))

crypto/err/err.c:683:10: 
      681.       ERR_STATE *state = NULL;
      682.   
      683. >     if (!RUN_ONCE(&err_init, err_do_init))
      684.           return NULL;
      685.   

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/err/err.c:683:10: Condition is false
      681.       ERR_STATE *state = NULL;
      682.   
      683.       if (!RUN_ONCE(&err_init, err_do_init))
                      ^
      684.           return NULL;
      685.   

crypto/err/err.c:683:10: Taking true branch
      681.       ERR_STATE *state = NULL;
      682.   
      683.       if (!RUN_ONCE(&err_init, err_do_init))
                      ^
      684.           return NULL;
      685.   

crypto/err/err.c:684:9: 
      682.   
      683.       if (!RUN_ONCE(&err_init, err_do_init))
      684. >         return NULL;
      685.   
      686.       state = CRYPTO_THREAD_get_local(&err_thread_local);

crypto/err/err.c:704:1: return from a call to ERR_get_state
      702.   
      703.       return state;
      704. > }
      705.   
      706.   int ERR_get_next_error_library(void)

crypto/err/err.c:389:9: Taking true branch
    387.   #endif
    388.       es = ERR_get_state();
    389.       if (es == NULL)
                   ^
    390.           return;
    391.   

crypto/err/err.c:390:9: 
    388.       es = ERR_get_state();
    389.       if (es == NULL)
    390. >         return;
    391.   
    392.       es->top = (es->top + 1) % ERR_NUM_ERRORS;

crypto/err/err.c:400:1: return from a call to ERR_put_error
    398.       es->err_line[es->top] = line;
    399.       err_clear_data(es, es->top);
    400. > }
    401.   
    402.   void ERR_clear_error(void)

crypto/evp/digest.c:188:9: 
  186.       if ((in == NULL) || (in->digest == NULL)) {
  187.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  188. >         return 0;
  189.       }
  190.   #ifndef OPENSSL_NO_ENGINE

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:264:1: start of procedure CRYPTO_free()
    262.   }
    263.   
    264. > void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:266:9: Taking true branch
    264.   void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    267.           free_impl(str, file, line);
    268.           return;

crypto/mem.c:266:30: Taking true branch
    264.   void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    267.           free_impl(str, file, line);
    268.           return;

crypto/mem.c:267:9: Skipping __function_pointer__(): unresolved function pointer
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    267.           free_impl(str, file, line);
                   ^
    268.           return;
    269.       }

crypto/mem.c:268:9: 
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    267.           free_impl(str, file, line);
    268. >         return;
    269.       }
    270.   

crypto/mem.c:282:1: return from a call to CRYPTO_free
    280.       free(str);
    281.   #endif
    282. > }
    283.   
    284.   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)
