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


crypto/evp/p_sign.c:65:1: start of procedure EVP_SignFinal()
63.   #include "internal/evp_int.h"
64.   
65. > int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
66.                     unsigned int *siglen, EVP_PKEY *pkey)
67.   {

crypto/evp/p_sign.c:69:5: 
67.   {
68.       unsigned char m[EVP_MAX_MD_SIZE];
69. >     unsigned int m_len = 0;
70.       int i = 0;
71.       size_t sltmp;

crypto/evp/p_sign.c:70:5: 
68.       unsigned char m[EVP_MAX_MD_SIZE];
69.       unsigned int m_len = 0;
70. >     int i = 0;
71.       size_t sltmp;
72.       EVP_PKEY_CTX *pkctx = NULL;

crypto/evp/p_sign.c:72:5: 
70.       int i = 0;
71.       size_t sltmp;
72. >     EVP_PKEY_CTX *pkctx = NULL;
73.   
74.       *siglen = 0;

crypto/evp/p_sign.c:74:5: 
72.       EVP_PKEY_CTX *pkctx = NULL;
73.   
74. >     *siglen = 0;
75.       if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_FINALISE)) {
76.           if (!EVP_DigestFinal_ex(ctx, m, &m_len))

crypto/evp/p_sign.c:75:9: 
73.   
74.       *siglen = 0;
75. >     if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_FINALISE)) {
76.           if (!EVP_DigestFinal_ex(ctx, m, &m_len))
77.               goto err;

crypto/evp/evp_lib.c:527:1: start of procedure EVP_MD_CTX_test_flags()
  525.   }
  526.   
  527. > int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags)
  528.   {
  529.       return (ctx->flags & flags);

crypto/evp/evp_lib.c:529:5: 
  527.   int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags)
  528.   {
  529. >     return (ctx->flags & flags);
  530.   }
  531.   

crypto/evp/evp_lib.c:530:1: return from a call to EVP_MD_CTX_test_flags
  528.   {
  529.       return (ctx->flags & flags);
  530. > }
  531.   
  532.   void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags)

crypto/evp/p_sign.c:75:9: Taking false branch
73.   
74.       *siglen = 0;
75.       if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_FINALISE)) {
              ^
76.           if (!EVP_DigestFinal_ex(ctx, m, &m_len))
77.               goto err;

crypto/evp/p_sign.c:79:9: 
77.               goto err;
78.       } else {
79. >         int rv = 0;
80.           EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
81.           if (tmp_ctx == NULL) {

crypto/evp/p_sign.c:80:9: 
78.       } else {
79.           int rv = 0;
80. >         EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
81.           if (tmp_ctx == NULL) {
82.               EVPerr(EVP_F_EVP_SIGNFINAL, ERR_R_MALLOC_FAILURE);

crypto/evp/digest.c:147:1: start of procedure EVP_MD_CTX_new()
  145.   }
  146.   
  147. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  148.   {
  149.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:149:5: 
  147.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  148.   {
  149. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  150.   }
  151.   

crypto/mem.c:146:1: start of procedure CRYPTO_zalloc()
    144.   }
    145.   
    146. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    147.   {
    148.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:148:5: 
    146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    147.   {
    148. >     void *ret = CRYPTO_malloc(num, file, line);
    149.   
    150.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
      117.   }
      118.   
      119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121.       void *ret = NULL;

crypto/mem.c:121:5: 
      119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121. >     void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      124.           return malloc_impl(num, file, line);
      125.   

crypto/mem.c:126:9: Taking false branch
      124.           return malloc_impl(num, file, line);
      125.   
      126.       if (num <= 0)
                     ^
      127.           return NULL;
      128.   

crypto/mem.c:129:5: 
      127.           return NULL;
      128.   
      129. >     allow_customize = 0;
      130.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      131.       if (call_malloc_debug) {

crypto/mem.c:139:5: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:139:24: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:140:5: 
      138.   #else
      139.       osslargused(file); osslargused(line);
      140. >     ret = malloc(num);
      141.   #endif
      142.   

crypto/mem.c:143:5: 
      141.   #endif
      142.   
      143. >     return ret;
      144.   }
      145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
      142.   
      143.       return ret;
      144. > }
      145.   
      146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:150:9: Taking true branch
    148.       void *ret = CRYPTO_malloc(num, file, line);
    149.   
    150.       if (ret != NULL)
                   ^
    151.           memset(ret, 0, num);
    152.       return ret;

crypto/mem.c:151:9: 
    149.   
    150.       if (ret != NULL)
    151. >         memset(ret, 0, num);
    152.       return ret;
    153.   }

crypto/mem.c:152:5: 
    150.       if (ret != NULL)
    151.           memset(ret, 0, num);
    152. >     return ret;
    153.   }
    154.   

crypto/mem.c:153:1: return from a call to CRYPTO_zalloc
    151.           memset(ret, 0, num);
    152.       return ret;
    153. > }
    154.   
    155.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:150:1: return from a call to EVP_MD_CTX_new
  148.   {
  149.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  150. > }
  151.   
  152.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/evp/p_sign.c:81:13: Taking false branch
79.           int rv = 0;
80.           EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
81.           if (tmp_ctx == NULL) {
                  ^
82.               EVPerr(EVP_F_EVP_SIGNFINAL, ERR_R_MALLOC_FAILURE);
83.               return 0;

crypto/evp/p_sign.c:85:9: 
83.               return 0;
84.           }
85. >         rv = EVP_MD_CTX_copy_ex(tmp_ctx, ctx);
86.           if (rv)
87.               rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len);

crypto/evp/digest.c:286:1: start of procedure EVP_MD_CTX_copy_ex()
  284.   }
  285.   
  286. > int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  287.   {
  288.       unsigned char *tmp_buf;

crypto/evp/digest.c:289:10: Taking false branch
  287.   {
  288.       unsigned char *tmp_buf;
  289.       if ((in == NULL) || (in->digest == NULL)) {
                  ^
  290.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  291.           return 0;

crypto/evp/digest.c:289:26: Taking true branch
  287.   {
  288.       unsigned char *tmp_buf;
  289.       if ((in == NULL) || (in->digest == NULL)) {
                                  ^
  290.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  291.           return 0;

crypto/evp/digest.c:290:9: Skipping ERR_put_error(): empty list of specs
  288.       unsigned char *tmp_buf;
  289.       if ((in == NULL) || (in->digest == NULL)) {
  290.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
                 ^
  291.           return 0;
  292.       }

crypto/evp/digest.c:291:9: 
  289.       if ((in == NULL) || (in->digest == NULL)) {
  290.           EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED);
  291. >         return 0;
  292.       }
  293.   #ifndef OPENSSL_NO_ENGINE

crypto/evp/digest.c:343:1: return from a call to EVP_MD_CTX_copy_ex
  341.   
  342.       return 1;
  343. > }
  344.   
  345.   int EVP_Digest(const void *data, size_t count,

crypto/evp/p_sign.c:86:13: Taking false branch
84.           }
85.           rv = EVP_MD_CTX_copy_ex(tmp_ctx, ctx);
86.           if (rv)
                  ^
87.               rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len);
88.           EVP_MD_CTX_free(tmp_ctx);

crypto/evp/p_sign.c:88:9: 
86.           if (rv)
87.               rv = EVP_DigestFinal_ex(tmp_ctx, m, &m_len);
88. >         EVP_MD_CTX_free(tmp_ctx);
89.           if (!rv)
90.               return 0;

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_free()
  150.   }
  151.   
  152. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  153.   {
  154.       EVP_MD_CTX_reset(ctx);

crypto/evp/digest.c:154:5: Skipping EVP_MD_CTX_reset(): empty list of specs
  152.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
  153.   {
  154.       EVP_MD_CTX_reset(ctx);
             ^
  155.       OPENSSL_free(ctx);
  156.   }

crypto/evp/digest.c:155:5: 
  153.   {
  154.       EVP_MD_CTX_reset(ctx);
  155. >     OPENSSL_free(ctx);
  156.   }
  157.   

crypto/mem.c:210:1: start of procedure CRYPTO_free()
    208.   }
    209.   
    210. > void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:212:9: Taking true branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:212:30: Taking true branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:213:9: Skipping __function_pointer__(): unresolved function pointer
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    213.           free_impl(str, file, line);
                   ^
    214.           return;
    215.       }

crypto/mem.c:214:9: 
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    213.           free_impl(str, file, line);
    214. >         return;
    215.       }
    216.   

crypto/mem.c:228:1: return from a call to CRYPTO_free
    226.       free(str);
    227.   #endif
    228. > }
    229.   
    230.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:156:1: return from a call to EVP_MD_CTX_free
  154.       EVP_MD_CTX_reset(ctx);
  155.       OPENSSL_free(ctx);
  156. > }
  157.   
  158.   int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
