diff options
author | Vitaly Chikunov <vt@altlinux.org> | 2022-01-10 04:27:00 +0300 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@users.noreply.github.com> | 2022-01-10 13:33:09 +0300 |
commit | da0c648be057d9d9277a5a17411d4acb5dfe710f (patch) | |
tree | 70c78dcc81e5c370ac923abfe0ff75b8e248261e | |
parent | eea1e27c2b49d7604df939aeefaa7f45a5519fc8 (diff) | |
download | gost-engine-da0c648be057d9d9277a5a17411d4acb5dfe710f.zip gost-engine-da0c648be057d9d9277a5a17411d4acb5dfe710f.tar.gz gost-engine-da0c648be057d9d9277a5a17411d4acb5dfe710f.tar.bz2 |
gost_prov: OPENSSL_free what is OPENSSL_zalloc'd
*** CID 345254: API usage errors (ALLOC_FREE_MISMATCH)
/gost_prov.c: 71 in provider_ctx_new()
65 && populate_gost_engine(ctx->e)) {
66 ctx->core_handle = core;
67
68 /* Ugly hack */
69 err_handle = ctx->proverr_handle;
70 } else {
>>> CID 345254: API usage errors (ALLOC_FREE_MISMATCH)
>>> Calling "provider_ctx_free" frees "ctx" using "free" but it should have been freed using "CRYPTO_free".
71 provider_ctx_free(ctx);
72 ctx = NULL;
73 }
74 return ctx;
75 }
Fixes: f5a3951 ("gost_prov: Avoid access to unallocated memory")
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
-rw-r--r-- | gost_prov.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gost_prov.c b/gost_prov.c index 3d23765..eab5918 100644 --- a/gost_prov.c +++ b/gost_prov.c @@ -49,7 +49,7 @@ static void provider_ctx_free(PROV_CTX *ctx) proverr_free_handle(ctx->proverr_handle); OSSL_LIB_CTX_free(ctx->libctx); } - free(ctx); + OPENSSL_free(ctx); } extern int populate_gost_engine(ENGINE *e); |