crypto/hmac/hmac.c:133: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 129, column 21 is not reachable after line 133, column 13.
Showing all 44 steps of the trace


crypto/hmac/hmac.c:127:1: start of procedure HMAC_CTX_new()
125.   }
126.   
127. > HMAC_CTX *HMAC_CTX_new(void)
128.   {
129.       HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));

crypto/hmac/hmac.c:129:5: 
127.   HMAC_CTX *HMAC_CTX_new(void)
128.   {
129. >     HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));
130.   
131.       if (ctx != NULL) {

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/hmac/hmac.c:131:9: Taking true branch
129.       HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));
130.   
131.       if (ctx != NULL) {
               ^
132.           if (!HMAC_CTX_reset(ctx)) {
133.               HMAC_CTX_free(ctx);

crypto/hmac/hmac.c:132:14: 
130.   
131.       if (ctx != NULL) {
132. >         if (!HMAC_CTX_reset(ctx)) {
133.               HMAC_CTX_free(ctx);
134.               return NULL;

crypto/hmac/hmac.c:178:1: start of procedure HMAC_CTX_reset()
  176.   }
  177.   
  178. > int HMAC_CTX_reset(HMAC_CTX *ctx)
  179.   {
  180.       hmac_ctx_cleanup(ctx);

crypto/hmac/hmac.c:180:5: 
  178.   int HMAC_CTX_reset(HMAC_CTX *ctx)
  179.   {
  180. >     hmac_ctx_cleanup(ctx);
  181.       if (!hmac_ctx_alloc_mds(ctx)) {
  182.           hmac_ctx_cleanup(ctx);

crypto/hmac/hmac.c:140:1: start of procedure hmac_ctx_cleanup()
    138.   }
    139.   
    140. > static void hmac_ctx_cleanup(HMAC_CTX *ctx)
    141.   {
    142.       EVP_MD_CTX_reset(ctx->i_ctx);

crypto/hmac/hmac.c:142:5: Skipping EVP_MD_CTX_reset(): empty list of specs
    140.   static void hmac_ctx_cleanup(HMAC_CTX *ctx)
    141.   {
    142.       EVP_MD_CTX_reset(ctx->i_ctx);
               ^
    143.       EVP_MD_CTX_reset(ctx->o_ctx);
    144.       EVP_MD_CTX_reset(ctx->md_ctx);

crypto/hmac/hmac.c:143:5: Skipping EVP_MD_CTX_reset(): empty list of specs
    141.   {
    142.       EVP_MD_CTX_reset(ctx->i_ctx);
    143.       EVP_MD_CTX_reset(ctx->o_ctx);
               ^
    144.       EVP_MD_CTX_reset(ctx->md_ctx);
    145.       ctx->md = NULL;

crypto/hmac/hmac.c:144:5: Skipping EVP_MD_CTX_reset(): empty list of specs
    142.       EVP_MD_CTX_reset(ctx->i_ctx);
    143.       EVP_MD_CTX_reset(ctx->o_ctx);
    144.       EVP_MD_CTX_reset(ctx->md_ctx);
               ^
    145.       ctx->md = NULL;
    146.       ctx->key_length = 0;

crypto/hmac/hmac.c:145:5: 
    143.       EVP_MD_CTX_reset(ctx->o_ctx);
    144.       EVP_MD_CTX_reset(ctx->md_ctx);
    145. >     ctx->md = NULL;
    146.       ctx->key_length = 0;
    147.       OPENSSL_cleanse(ctx->key, sizeof(ctx->key));

crypto/hmac/hmac.c:146:5: 
    144.       EVP_MD_CTX_reset(ctx->md_ctx);
    145.       ctx->md = NULL;
    146. >     ctx->key_length = 0;
    147.       OPENSSL_cleanse(ctx->key, sizeof(ctx->key));
    148.   }

crypto/hmac/hmac.c:147:5: Skipping OPENSSL_cleanse(): method has no implementation
    145.       ctx->md = NULL;
    146.       ctx->key_length = 0;
    147.       OPENSSL_cleanse(ctx->key, sizeof(ctx->key));
               ^
    148.   }
    149.   

crypto/hmac/hmac.c:148:1: return from a call to hmac_ctx_cleanup
    146.       ctx->key_length = 0;
    147.       OPENSSL_cleanse(ctx->key, sizeof(ctx->key));
    148. > }
    149.   
    150.   void HMAC_CTX_free(HMAC_CTX *ctx)

crypto/hmac/hmac.c:181:10: Taking true branch
  179.   {
  180.       hmac_ctx_cleanup(ctx);
  181.       if (!hmac_ctx_alloc_mds(ctx)) {
                  ^
  182.           hmac_ctx_cleanup(ctx);
  183.           return 0;

crypto/hmac/hmac.c:182:9: 
  180.       hmac_ctx_cleanup(ctx);
  181.       if (!hmac_ctx_alloc_mds(ctx)) {
  182. >         hmac_ctx_cleanup(ctx);
  183.           return 0;
  184.       }

crypto/hmac/hmac.c:140:1: start of procedure hmac_ctx_cleanup()
    138.   }
    139.   
    140. > static void hmac_ctx_cleanup(HMAC_CTX *ctx)
    141.   {
    142.       EVP_MD_CTX_reset(ctx->i_ctx);

crypto/hmac/hmac.c:142:5: Skipping EVP_MD_CTX_reset(): empty list of specs
    140.   static void hmac_ctx_cleanup(HMAC_CTX *ctx)
    141.   {
    142.       EVP_MD_CTX_reset(ctx->i_ctx);
               ^
    143.       EVP_MD_CTX_reset(ctx->o_ctx);
    144.       EVP_MD_CTX_reset(ctx->md_ctx);

crypto/hmac/hmac.c:143:5: Skipping EVP_MD_CTX_reset(): empty list of specs
    141.   {
    142.       EVP_MD_CTX_reset(ctx->i_ctx);
    143.       EVP_MD_CTX_reset(ctx->o_ctx);
               ^
    144.       EVP_MD_CTX_reset(ctx->md_ctx);
    145.       ctx->md = NULL;

crypto/hmac/hmac.c:144:5: Skipping EVP_MD_CTX_reset(): empty list of specs
    142.       EVP_MD_CTX_reset(ctx->i_ctx);
    143.       EVP_MD_CTX_reset(ctx->o_ctx);
    144.       EVP_MD_CTX_reset(ctx->md_ctx);
               ^
    145.       ctx->md = NULL;
    146.       ctx->key_length = 0;

crypto/hmac/hmac.c:145:5: 
    143.       EVP_MD_CTX_reset(ctx->o_ctx);
    144.       EVP_MD_CTX_reset(ctx->md_ctx);
    145. >     ctx->md = NULL;
    146.       ctx->key_length = 0;
    147.       OPENSSL_cleanse(ctx->key, sizeof(ctx->key));

crypto/hmac/hmac.c:146:5: 
    144.       EVP_MD_CTX_reset(ctx->md_ctx);
    145.       ctx->md = NULL;
    146. >     ctx->key_length = 0;
    147.       OPENSSL_cleanse(ctx->key, sizeof(ctx->key));
    148.   }

crypto/hmac/hmac.c:147:5: Skipping OPENSSL_cleanse(): method has no implementation
    145.       ctx->md = NULL;
    146.       ctx->key_length = 0;
    147.       OPENSSL_cleanse(ctx->key, sizeof(ctx->key));
               ^
    148.   }
    149.   

crypto/hmac/hmac.c:148:1: return from a call to hmac_ctx_cleanup
    146.       ctx->key_length = 0;
    147.       OPENSSL_cleanse(ctx->key, sizeof(ctx->key));
    148. > }
    149.   
    150.   void HMAC_CTX_free(HMAC_CTX *ctx)

crypto/hmac/hmac.c:183:9: 
  181.       if (!hmac_ctx_alloc_mds(ctx)) {
  182.           hmac_ctx_cleanup(ctx);
  183. >         return 0;
  184.       }
  185.       return 1;

crypto/hmac/hmac.c:186:1: return from a call to HMAC_CTX_reset
  184.       }
  185.       return 1;
  186. > }
  187.   
  188.   int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx)

crypto/hmac/hmac.c:132:14: Taking true branch
130.   
131.       if (ctx != NULL) {
132.           if (!HMAC_CTX_reset(ctx)) {
                    ^
133.               HMAC_CTX_free(ctx);
134.               return NULL;

crypto/hmac/hmac.c:133:13: Skipping HMAC_CTX_free(): empty list of specs
131.       if (ctx != NULL) {
132.           if (!HMAC_CTX_reset(ctx)) {
133.               HMAC_CTX_free(ctx);
                   ^
134.               return NULL;
135.           }
