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


crypto/evp/digest.c:280:1: invalidation part of the trace starts here
278.   }
279.   
280. > int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
281.   {
282.       EVP_MD_CTX_reset(out);

crypto/evp/digest.c:280:1: parameter `out` of EVP_MD_CTX_copy
  278.   }
  279.   
  280. > int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  281.   {
  282.       EVP_MD_CTX_reset(out);

crypto/evp/digest.c:282:5: when calling `EVP_MD_CTX_reset` here
  280.   int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  281.   {
  282.       EVP_MD_CTX_reset(out);
             ^
  283.       return EVP_MD_CTX_copy_ex(out, in);
  284.   }

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.       ENGINE_finish(ctx->engine);

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

crypto/evp/pmeth_lib.c:329:5: when calling `EVP_PKEY_free` here
      327.           ctx->pmeth->cleanup(ctx);
      328.       EVP_PKEY_free(ctx->pkey);
      329.       EVP_PKEY_free(ctx->peerkey);
                 ^
      330.   #ifndef OPENSSL_NO_ENGINE
      331.       ENGINE_finish(ctx->engine);

crypto/evp/p_lib.c:412:1: parameter `x` of EVP_PKEY_free
        410.   }
        411.   
        412. > void EVP_PKEY_free(EVP_PKEY *x)
        413.   {
        414.       int i;

crypto/evp/p_lib.c:426:5: when calling `CRYPTO_free` here
        424.       EVP_PKEY_free_it(x);
        425.       sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
        426.       OPENSSL_free(x);
                   ^
        427.   }
        428.   

crypto/mem.c:210:1: parameter `str` of CRYPTO_free
          208.   }
          209.   
          210. > void CRYPTO_free(void *str, const char *file, int line)
          211.   {
          212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:226:5: was invalidated by call to `free()`
          224.       }
          225.   #else
          226.       free(str);
                     ^
          227.   #endif
          228.   }

crypto/evp/digest.c:280:1: use-after-lifetime part of the trace starts here
278.   }
279.   
280. > int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
281.   {
282.       EVP_MD_CTX_reset(out);

crypto/evp/digest.c:280:1: parameter `out` of EVP_MD_CTX_copy
  278.   }
  279.   
  280. > int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)
  281.   {
  282.       EVP_MD_CTX_reset(out);

crypto/evp/digest.c:283:12: when calling `EVP_MD_CTX_copy_ex` here
  281.   {
  282.       EVP_MD_CTX_reset(out);
  283.       return EVP_MD_CTX_copy_ex(out, in);
                    ^
  284.   }
  285.   

crypto/mem.c:210:1: parameter `str` of CRYPTO_free
    208.   }
    209.   
    210. > void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:226:5: invalid access occurs here
    224.       }
    225.   #else
    226.       free(str);
               ^
    227.   #endif
    228.   }
