crypto/evp/m_sigver.c:161: error: MEMORY_LEAK
  memory dynamically allocated to `tmp_ctx` by call to `EVP_MD_CTX_new()` at line 160, column 35 is not reachable after line 161, column 37.
Showing all 38 steps of the trace


crypto/evp/m_sigver.c:128:1: start of procedure EVP_DigestSignFinal()
126.   }
127.   
128. > int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
129.                           size_t *siglen)
130.   {

crypto/evp/m_sigver.c:131:5: 
129.                           size_t *siglen)
130.   {
131. >     int sctx = 0, r = 0;
132.       EVP_PKEY_CTX *pctx = ctx->pctx;
133.       if (pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM) {

crypto/evp/m_sigver.c:132:5: 
130.   {
131.       int sctx = 0, r = 0;
132. >     EVP_PKEY_CTX *pctx = ctx->pctx;
133.       if (pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM) {
134.           if (!sigret)

crypto/evp/m_sigver.c:133:9: Taking false branch
131.       int sctx = 0, r = 0;
132.       EVP_PKEY_CTX *pctx = ctx->pctx;
133.       if (pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM) {
               ^
134.           if (!sigret)
135.               return pctx->pmeth->signctx(pctx, sigret, siglen, ctx);

crypto/evp/m_sigver.c:147:9: Taking true branch
145.           return r;
146.       }
147.       if (pctx->pmeth->signctx)
               ^
148.           sctx = 1;
149.       else

crypto/evp/m_sigver.c:148:9: 
146.       }
147.       if (pctx->pmeth->signctx)
148. >         sctx = 1;
149.       else
150.           sctx = 0;

crypto/evp/m_sigver.c:151:9: Taking true branch
149.       else
150.           sctx = 0;
151.       if (sigret) {
               ^
152.           unsigned char md[EVP_MAX_MD_SIZE];
153.           unsigned int mdlen = 0;

crypto/evp/m_sigver.c:153:9: 
151.       if (sigret) {
152.           unsigned char md[EVP_MAX_MD_SIZE];
153. >         unsigned int mdlen = 0;
154.           if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {
155.               if (sctx)

crypto/evp/m_sigver.c:154:13: Taking false branch
152.           unsigned char md[EVP_MAX_MD_SIZE];
153.           unsigned int mdlen = 0;
154.           if (ctx->flags & EVP_MD_CTX_FLAG_FINALISE) {
                   ^
155.               if (sctx)
156.                   r = ctx->pctx->pmeth->signctx(ctx->pctx, sigret, siglen, ctx);

crypto/evp/m_sigver.c:160:13: 
158.                   r = EVP_DigestFinal_ex(ctx, md, &mdlen);
159.           } else {
160. >             EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
161.               if (tmp_ctx == NULL || !EVP_MD_CTX_copy_ex(tmp_ctx, ctx))
162.                   return 0;

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/m_sigver.c:161:17: Taking false branch
159.           } else {
160.               EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
161.               if (tmp_ctx == NULL || !EVP_MD_CTX_copy_ex(tmp_ctx, ctx))
                       ^
162.                   return 0;
163.               if (sctx)

crypto/evp/m_sigver.c:161:37: 
159.           } else {
160.               EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
161. >             if (tmp_ctx == NULL || !EVP_MD_CTX_copy_ex(tmp_ctx, ctx))
162.                   return 0;
163.               if (sctx)

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/m_sigver.c:161:37: Taking true branch
159.           } else {
160.               EVP_MD_CTX *tmp_ctx = EVP_MD_CTX_new();
161.               if (tmp_ctx == NULL || !EVP_MD_CTX_copy_ex(tmp_ctx, ctx))
                                           ^
162.                   return 0;
163.               if (sctx)
