summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-02-10 16:21:30 +0000
committerMatt Caswell <matt@openssl.org>2015-02-25 17:46:20 +0000
commiteafdbd8ec3acc2ebbb13fe45874fe38eccdde38a (patch)
treea4f91e12013ae9c2ec24be04c0452bcb439cf7dc
parent1159e24d564e55826406c5f39a3881311c11d697 (diff)
downloadopenssl-new-eafdbd8ec3acc2ebbb13fe45874fe38eccdde38a.tar.gz
Remove pointless free, and use preferred way of calling d2i_* functions
Reviewed-by: Emilia Käsper <emilia@openssl.org>
-rw-r--r--crypto/ec/ec_asn1.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
index 1088e8916e..6ff94a3563 100644
--- a/crypto/ec/ec_asn1.c
+++ b/crypto/ec/ec_asn1.c
@@ -1017,14 +1017,8 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
EC_KEY *ret = NULL;
EC_PRIVATEKEY *priv_key = NULL;
- if ((priv_key = EC_PRIVATEKEY_new()) == NULL) {
- ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_MALLOC_FAILURE);
- return NULL;
- }
-
- if ((priv_key = d2i_EC_PRIVATEKEY(&priv_key, in, len)) == NULL) {
+ if ((priv_key = d2i_EC_PRIVATEKEY(NULL, in, len)) == NULL) {
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB);
- EC_PRIVATEKEY_free(priv_key);
return NULL;
}