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


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

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

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

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

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

crypto/evp/evp_enc.c:20:1: parameter `c` of EVP_CIPHER_CTX_reset
      18.   #include "evp_locl.h"
      19.   
      20. > int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c)
      21.   {
      22.       if (c == NULL)

crypto/evp/evp_enc.c:31:5: when calling `CRYPTO_free` here
      29.               OPENSSL_cleanse(c->cipher_data, c->cipher->ctx_size);
      30.       }
      31.       OPENSSL_free(c->cipher_data);
                ^
      32.   #ifndef OPENSSL_NO_ENGINE
      33.       ENGINE_finish(c->engine);

crypto/mem.c:264:1: parameter `str` of CRYPTO_free
        262.   }
        263.   
        264. > void CRYPTO_free(void *str, const char *file, int line)
        265.   {
        266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:280:5: was invalidated by call to `free()`
        278.       }
        279.   #else
        280.       free(str);
                   ^
        281.   #endif
        282.   }

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

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

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

crypto/mem.c:264:1: parameter `str` of CRYPTO_free
    262.   }
    263.   
    264. > void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:280:5: invalid access occurs here
    278.       }
    279.   #else
    280.       free(str);
               ^
    281.   #endif
    282.   }
