crypto/cmac/cmac.c:83: error: USE_AFTER_FREE
  call to `EVP_CIPHER_CTX_free()` eventually accesses memory that was invalidated by call to `free()` on line 82 indirectly during the call to `CMAC_CTX_cleanup()`.
Showing all 14 steps of the trace


crypto/cmac/cmac.c:78:1: invalidation part of the trace starts here
76.   }
77.   
78. > void CMAC_CTX_free(CMAC_CTX *ctx)
79.   {
80.       if (!ctx)

crypto/cmac/cmac.c:78:1: parameter `ctx` of CMAC_CTX_free
  76.   }
  77.   
  78. > void CMAC_CTX_free(CMAC_CTX *ctx)
  79.   {
  80.       if (!ctx)

crypto/cmac/cmac.c:82:5: when calling `CMAC_CTX_cleanup` here
  80.       if (!ctx)
  81.           return;
  82.       CMAC_CTX_cleanup(ctx);
            ^
  83.       EVP_CIPHER_CTX_free(ctx->cctx);
  84.       OPENSSL_free(ctx);

crypto/cmac/cmac.c:63:1: parameter `ctx` of CMAC_CTX_cleanup
    61.   }
    62.   
    63. > void CMAC_CTX_cleanup(CMAC_CTX *ctx)
    64.   {
    65.       EVP_CIPHER_CTX_reset(ctx->cctx);

crypto/cmac/cmac.c:65:5: when calling `EVP_CIPHER_CTX_reset` here
    63.   void CMAC_CTX_cleanup(CMAC_CTX *ctx)
    64.   {
    65.       EVP_CIPHER_CTX_reset(ctx->cctx);
              ^
    66.       OPENSSL_cleanse(ctx->tbl, EVP_MAX_BLOCK_LENGTH);
    67.       OPENSSL_cleanse(ctx->k1, EVP_MAX_BLOCK_LENGTH);

crypto/evp/evp_enc.c:24:1: parameter `ctx` of EVP_CIPHER_CTX_reset
      22.   #include "evp_locl.h"
      23.   
      24. > int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx)
      25.   {
      26.       if (ctx == NULL)

crypto/evp/evp_enc.c:53:5: when calling `CRYPTO_free` here
      51.               OPENSSL_cleanse(ctx->cipher_data, ctx->cipher->ctx_size);
      52.       }
      53.       OPENSSL_free(ctx->cipher_data);
                ^
      54.   #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
      55.       ENGINE_finish(ctx->engine);

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
        293.   }
        294.   
        295. > void CRYPTO_free(void *str, const char *file, int line)
        296.   {
        297.       INCREMENT(free_count);

crypto/mem.c:312:5: was invalidated by call to `free()`
        310.       }
        311.   #else
        312.       free(str);
                   ^
        313.   #endif
        314.   }

crypto/cmac/cmac.c:78:1: use-after-lifetime part of the trace starts here
76.   }
77.   
78. > void CMAC_CTX_free(CMAC_CTX *ctx)
79.   {
80.       if (!ctx)

crypto/cmac/cmac.c:78:1: parameter `ctx` of CMAC_CTX_free
  76.   }
  77.   
  78. > void CMAC_CTX_free(CMAC_CTX *ctx)
  79.   {
  80.       if (!ctx)

crypto/cmac/cmac.c:83:5: when calling `EVP_CIPHER_CTX_free` here
  81.           return;
  82.       CMAC_CTX_cleanup(ctx);
  83.       EVP_CIPHER_CTX_free(ctx->cctx);
            ^
  84.       OPENSSL_free(ctx);
  85.   }

crypto/mem.c:295:1: parameter `str` of CRYPTO_free
    293.   }
    294.   
    295. > void CRYPTO_free(void *str, const char *file, int line)
    296.   {
    297.       INCREMENT(free_count);

crypto/mem.c:312:5: invalid access occurs here
    310.       }
    311.   #else
    312.       free(str);
               ^
    313.   #endif
    314.   }
