crypto/evp/digest.c:288: error: USE_AFTER_FREE
  call to `EVP_MD_CTX_copy_ex()` eventually accesses memory that was invalidated by call to `free()` on line 287 indirectly during the call to `EVP_MD_CTX_reset()`.
Showing all 14 steps of the trace


crypto/evp/digest.c:285:1: invalidation part of the trace starts here
283.   }
284.   
285. > int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
286.   {
287.       EVP_MD_CTX_reset(out);

crypto/evp/digest.c:285:1: parameter `out` of EVP_MD_CTX_copy
  283.   }
  284.   
  285. > int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  286.   {
  287.       EVP_MD_CTX_reset(out);

crypto/evp/digest.c:287:5: when calling `EVP_MD_CTX_reset` here
  285.   int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  286.   {
  287.       EVP_MD_CTX_reset(out);
             ^
  288.       return EVP_MD_CTX_copy_ex(out, in);
  289.   }

crypto/evp/digest.c:122:1: parameter `ctx` of EVP_MD_CTX_reset
    120.   
    121.   /* This call frees resources associated with the context */
    122. > int EVP_MD_CTX_reset(EVP_MD_CTX *ctx)
    123.   {
    124.       if (ctx == NULL)

crypto/evp/digest.c:138:5: when calling `EVP_PKEY_CTX_free` here
    136.           OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size);
    137.       }
    138.       EVP_PKEY_CTX_free(ctx->pctx);
               ^
    139.   #ifndef OPENSSL_NO_ENGINE
    140.       if (ctx->engine)

crypto/evp/pmeth_lib.c:323:1: parameter `ctx` of EVP_PKEY_CTX_free
      321.   }
      322.   
      323. > void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx)
      324.   {
      325.       if (ctx == NULL)

crypto/evp/pmeth_lib.c:339:5: when calling `CRYPTO_free` here
      337.           ENGINE_finish(ctx->engine);
      338.   #endif
      339.       OPENSSL_free(ctx);
                 ^
      340.   }
      341.   

crypto/mem.c:225:1: parameter `str` of CRYPTO_free
        223.   }
        224.   
        225. > void CRYPTO_free(void *str, const char *file, int line)
        226.   {
        227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:241:5: was invalidated by call to `free()`
        239.       }
        240.   #else
        241.       free(str);
                   ^
        242.   #endif
        243.   }

crypto/evp/digest.c:285:1: use-after-lifetime part of the trace starts here
283.   }
284.   
285. > int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
286.   {
287.       EVP_MD_CTX_reset(out);

crypto/evp/digest.c:285:1: parameter `out` of EVP_MD_CTX_copy
  283.   }
  284.   
  285. > int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  286.   {
  287.       EVP_MD_CTX_reset(out);

crypto/evp/digest.c:288:12: when calling `EVP_MD_CTX_copy_ex` here
  286.   {
  287.       EVP_MD_CTX_reset(out);
  288.       return EVP_MD_CTX_copy_ex(out, in);
                    ^
  289.   }
  290.   

crypto/mem.c:225:1: parameter `str` of CRYPTO_free
    223.   }
    224.   
    225. > void CRYPTO_free(void *str, const char *file, int line)
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:241:5: invalid access occurs here
    239.       }
    240.   #else
    241.       free(str);
               ^
    242.   #endif
    243.   }
