diff options
author | Geoff Thorpe <geoff@openssl.org> | 2003-11-10 18:05:22 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2003-11-10 18:05:22 +0000 |
commit | f7a397cc8d0cf336907a7e05f7a9a94c3cd12877 (patch) | |
tree | 5905b98aeebcd094ea5e0de5b451404c26dfe6d2 /crypto/asn1/d2i_pu.c | |
parent | cd2e8a6f2da1d5a8e842f71511c68d1088629912 (diff) |
Avoid possible memory leaks in error-handling.
Submitted by: Nils Larsch
Reviewed by: Geoff Thorpe
Diffstat (limited to 'crypto/asn1/d2i_pu.c')
-rw-r--r-- | crypto/asn1/d2i_pu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c index 4c2bd4e5c8..d0fd732098 100644 --- a/crypto/asn1/d2i_pu.c +++ b/crypto/asn1/d2i_pu.c @@ -103,8 +103,8 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, #endif #ifndef OPENSSL_NO_DSA case EVP_PKEY_DSA: - if ((ret->pkey.dsa=d2i_DSAPublicKey(&(ret->pkey.dsa), - (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ + if (!d2i_DSAPublicKey(&(ret->pkey.dsa), + (const unsigned char **)pp,length)) /* TMP UGLY CAST */ { ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); goto err; @@ -113,8 +113,8 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, #endif #ifndef OPENSSL_NO_EC case EVP_PKEY_EC: - if ((ret->pkey.eckey = o2i_ECPublicKey(&(ret->pkey.eckey), - (const unsigned char **)pp, length)) == NULL) + if (!o2i_ECPublicKey(&(ret->pkey.eckey), + (const unsigned char **)pp, length)) { ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); goto err; |