mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Free EVP ctx pkey
This commit is contained in:
@ -16132,7 +16132,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD *md)
|
|||||||
{
|
{
|
||||||
WOLFSSL_ENTER("EVP_MD_CTX_cleanup");
|
WOLFSSL_ENTER("EVP_MD_CTX_cleanup");
|
||||||
if (ctx->pctx != NULL)
|
if (ctx->pctx != NULL)
|
||||||
wolfSSL_EVP_PKEY_CTX_free(ctx->pctx);
|
XFREE(ctx->pctx, NULL, DYNAMIC_TYPE_PUBLIC_KEY);
|
||||||
|
|
||||||
if (ctx->macType == (NID_hmac & 0xFF)) {
|
if (ctx->macType == (NID_hmac & 0xFF)) {
|
||||||
wc_HmacFree(&ctx->hash.hmac);
|
wc_HmacFree(&ctx->hash.hmac);
|
||||||
@ -23447,7 +23447,9 @@ void wolfSSL_EVP_PKEY_free(WOLFSSL_EVP_PKEY* key)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
wc_FreeMutex(&key->refMutex);
|
if (wc_FreeMutex(&key->refMutex) != 0) {
|
||||||
|
WOLFSSL_MSG("Couldn't free pkey mutex");
|
||||||
|
}
|
||||||
XFREE(key, key->heap, DYNAMIC_TYPE_PUBLIC_KEY);
|
XFREE(key, key->heap, DYNAMIC_TYPE_PUBLIC_KEY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -901,6 +901,8 @@ int wolfSSL_EVP_PKEY_CTX_free(WOLFSSL_EVP_PKEY_CTX *ctx)
|
|||||||
{
|
{
|
||||||
if (ctx == NULL) return 0;
|
if (ctx == NULL) return 0;
|
||||||
WOLFSSL_ENTER("EVP_PKEY_CTX_free");
|
WOLFSSL_ENTER("EVP_PKEY_CTX_free");
|
||||||
|
if (ctx->pkey != NULL)
|
||||||
|
wolfSSL_EVP_PKEY_free(ctx->pkey);
|
||||||
XFREE(ctx, NULL, DYNAMIC_TYPE_PUBLIC_KEY);
|
XFREE(ctx, NULL, DYNAMIC_TYPE_PUBLIC_KEY);
|
||||||
return WOLFSSL_SUCCESS;
|
return WOLFSSL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user