mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
Call OSSL_STORE_INFO_free on error path
This commit is contained in:
parent
80b88df4d3
commit
7f12c0884f
@ -301,19 +301,23 @@ dst__openssl_fromlabel_provider(int key_base_id, const char *engine,
|
||||
switch (OSSL_STORE_INFO_get_type(info)) {
|
||||
case OSSL_STORE_INFO_PKEY:
|
||||
if (*ppriv != NULL) {
|
||||
OSSL_STORE_INFO_free(info);
|
||||
DST_RET(DST_R_INVALIDPRIVATEKEY);
|
||||
}
|
||||
*ppriv = OSSL_STORE_INFO_get1_PKEY(info);
|
||||
if (EVP_PKEY_get_base_id(*ppriv) != key_base_id) {
|
||||
OSSL_STORE_INFO_free(info);
|
||||
DST_RET(DST_R_BADKEYTYPE);
|
||||
}
|
||||
break;
|
||||
case OSSL_STORE_INFO_PUBKEY:
|
||||
if (*ppub != NULL) {
|
||||
OSSL_STORE_INFO_free(info);
|
||||
DST_RET(DST_R_INVALIDPUBLICKEY);
|
||||
}
|
||||
*ppub = OSSL_STORE_INFO_get1_PUBKEY(info);
|
||||
if (EVP_PKEY_get_base_id(*ppub) != key_base_id) {
|
||||
OSSL_STORE_INFO_free(info);
|
||||
DST_RET(DST_R_BADKEYTYPE);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user