crypto/hmac/hmac.c:224: error: MEMORY_LEAK
  memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 214, column 22 is not reachable after line 224, column 5.
Showing all 47 steps of the trace


crypto/hmac/hmac.c:206:1: start of procedure HMAC_CTX_reset()
204.   }
205.   
206. > int HMAC_CTX_reset(HMAC_CTX *ctx)
207.   {
208.       hmac_ctx_cleanup(ctx);

crypto/hmac/hmac.c:208:5: Skipping hmac_ctx_cleanup(): empty list of specs
206.   int HMAC_CTX_reset(HMAC_CTX *ctx)
207.   {
208.       hmac_ctx_cleanup(ctx);
           ^
209.       if (ctx->i_ctx == NULL)
210.           ctx->i_ctx = EVP_MD_CTX_new();

crypto/hmac/hmac.c:209:9: Taking false branch
207.   {
208.       hmac_ctx_cleanup(ctx);
209.       if (ctx->i_ctx == NULL)
               ^
210.           ctx->i_ctx = EVP_MD_CTX_new();
211.       if (ctx->i_ctx == NULL)

crypto/hmac/hmac.c:211:9: Taking false branch
209.       if (ctx->i_ctx == NULL)
210.           ctx->i_ctx = EVP_MD_CTX_new();
211.       if (ctx->i_ctx == NULL)
               ^
212.           goto err;
213.       if (ctx->o_ctx == NULL)

crypto/hmac/hmac.c:213:9: Taking true branch
211.       if (ctx->i_ctx == NULL)
212.           goto err;
213.       if (ctx->o_ctx == NULL)
               ^
214.           ctx->o_ctx = EVP_MD_CTX_new();
215.       if (ctx->o_ctx == NULL)

crypto/hmac/hmac.c:214:9: 
212.           goto err;
213.       if (ctx->o_ctx == NULL)
214. >         ctx->o_ctx = EVP_MD_CTX_new();
215.       if (ctx->o_ctx == NULL)
216.           goto err;

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_new()
  150.   }
  151.   
  152. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:154:5: 
  152.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155.   }
  156.   

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

crypto/mem.c:158:5: 
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158. >     void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (num <= 0)
                     ^
      124.           return NULL;
      125.   

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

crypto/mem.c:136:5: 
      134.       }
      135.   #else
      136. >     (void)file;
      137.       (void)line;
      138.       ret = malloc(num);

crypto/mem.c:137:5: 
      135.   #else
      136.       (void)file;
      137. >     (void)line;
      138.       ret = malloc(num);
      139.   #endif

crypto/mem.c:138:5: 
      136.       (void)file;
      137.       (void)line;
      138. >     ret = malloc(num);
      139.   #endif
      140.   

crypto/mem.c:153:5: 
      151.   #endif
      152.   
      153. >     return ret;
      154.   }
      155.   

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

crypto/mem.c:160:9: Taking true branch
    158.       void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       if (ret != NULL)
                   ^
    161.           memset(ret, 0, num);
    162.       return ret;

crypto/mem.c:161:9: 
    159.   
    160.       if (ret != NULL)
    161. >         memset(ret, 0, num);
    162.       return ret;
    163.   }

crypto/mem.c:162:5: 
    160.       if (ret != NULL)
    161.           memset(ret, 0, num);
    162. >     return ret;
    163.   }
    164.   

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
    161.           memset(ret, 0, num);
    162.       return ret;
    163. > }
    164.   
    165.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:155:1: return from a call to EVP_MD_CTX_new
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155. > }
  156.   
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/hmac/hmac.c:215:9: Taking false branch
213.       if (ctx->o_ctx == NULL)
214.           ctx->o_ctx = EVP_MD_CTX_new();
215.       if (ctx->o_ctx == NULL)
               ^
216.           goto err;
217.       if (ctx->md_ctx == NULL)

crypto/hmac/hmac.c:217:9: Taking true branch
215.       if (ctx->o_ctx == NULL)
216.           goto err;
217.       if (ctx->md_ctx == NULL)
               ^
218.           ctx->md_ctx = EVP_MD_CTX_new();
219.       if (ctx->md_ctx == NULL)

crypto/hmac/hmac.c:218:9: 
216.           goto err;
217.       if (ctx->md_ctx == NULL)
218. >         ctx->md_ctx = EVP_MD_CTX_new();
219.       if (ctx->md_ctx == NULL)
220.           goto err;

crypto/evp/digest.c:152:1: start of procedure EVP_MD_CTX_new()
  150.   }
  151.   
  152. > EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));

crypto/evp/digest.c:154:5: 
  152.   EVP_MD_CTX *EVP_MD_CTX_new(void)
  153.   {
  154. >     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155.   }
  156.   

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

crypto/mem.c:158:5: 
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158. >     void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (num <= 0)
                     ^
      124.           return NULL;
      125.   

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

crypto/mem.c:136:5: 
      134.       }
      135.   #else
      136. >     (void)file;
      137.       (void)line;
      138.       ret = malloc(num);

crypto/mem.c:137:5: 
      135.   #else
      136.       (void)file;
      137. >     (void)line;
      138.       ret = malloc(num);
      139.   #endif

crypto/mem.c:138:5: 
      136.       (void)file;
      137.       (void)line;
      138. >     ret = malloc(num);
      139.   #endif
      140.   

crypto/mem.c:153:5: 
      151.   #endif
      152.   
      153. >     return ret;
      154.   }
      155.   

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

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

crypto/mem.c:162:5: 
    160.       if (ret != NULL)
    161.           memset(ret, 0, num);
    162. >     return ret;
    163.   }
    164.   

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
    161.           memset(ret, 0, num);
    162.       return ret;
    163. > }
    164.   
    165.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/evp/digest.c:155:1: return from a call to EVP_MD_CTX_new
  153.   {
  154.       return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  155. > }
  156.   
  157.   void EVP_MD_CTX_free(EVP_MD_CTX *ctx)

crypto/hmac/hmac.c:219:9: Taking true branch
217.       if (ctx->md_ctx == NULL)
218.           ctx->md_ctx = EVP_MD_CTX_new();
219.       if (ctx->md_ctx == NULL)
               ^
220.           goto err;
221.       ctx->md = NULL;

crypto/hmac/hmac.c:223:2: 
221.       ctx->md = NULL;
222.       return 1;
223. >  err:
224.       hmac_ctx_cleanup(ctx);
225.       return 0;

crypto/hmac/hmac.c:224:5: Skipping hmac_ctx_cleanup(): empty list of specs
222.       return 1;
223.    err:
224.       hmac_ctx_cleanup(ctx);
           ^
225.       return 0;
226.   }

int HMAC_CTX_reset(HMAC_CTX *ctx)
{
    hmac_ctx_cleanup(ctx);
    if (ctx->i_ctx == NULL)
        ctx->i_ctx = EVP_MD_CTX_new();
    if (ctx->i_ctx == NULL)
        goto err;
    if (ctx->o_ctx == NULL)
        ctx->o_ctx = EVP_MD_CTX_new();
    if (ctx->o_ctx == NULL)
        goto err;
    if (ctx->md_ctx == NULL)
        ctx->md_ctx = EVP_MD_CTX_new();
    if (ctx->md_ctx == NULL)
        goto err;
    ctx->md = NULL;
    return 1;
 err:
    hmac_ctx_cleanup(ctx);
    return 0;
}
['int HMAC_CTX_reset(HMAC_CTX *ctx)\n{\n    hmac_ctx_cleanup(ctx);\n    if (ctx->i_ctx == NULL)\n        ctx->i_ctx = EVP_MD_CTX_new();\n    if (ctx->i_ctx == NULL)\n        goto err;\n    if (ctx->o_ctx == NULL)\n        ctx->o_ctx = EVP_MD_CTX_new();\n    if (ctx->o_ctx == NULL)\n        goto err;\n    if (ctx->md_ctx == NULL)\n        ctx->md_ctx = EVP_MD_CTX_new();\n    if (ctx->md_ctx == NULL)\n        goto err;\n    ctx->md = NULL;\n    return 1;\n err:\n    hmac_ctx_cleanup(ctx);\n    return 0;\n}', 'EVP_MD_CTX *EVP_MD_CTX_new(void)\n{\n    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}']