mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
PR: 2088
Submitted by: Aleksey Samsonov <s4ms0n0v@gmail.com> Approved by: steve@openssl.org Fix memory leak in d2i_PublicKey().
This commit is contained in:
parent
773b63d6f9
commit
c18e51ba5e
@ -87,9 +87,13 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
}
|
||||
else ret= *a;
|
||||
|
||||
ret->save_type=type;
|
||||
ret->type=EVP_PKEY_type(type);
|
||||
switch (ret->type)
|
||||
if (!EVP_PKEY_set_type(ret, type))
|
||||
{
|
||||
ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB);
|
||||
goto err;
|
||||
}
|
||||
|
||||
switch (EVP_PKEY_id(ret))
|
||||
{
|
||||
#ifndef OPENSSL_NO_RSA
|
||||
case EVP_PKEY_RSA:
|
||||
|
Loading…
Reference in New Issue
Block a user