From: Matt Caswell Date: Tue, 10 Feb 2015 16:21:30 +0000 (+0000) Subject: Remove pointless free, and use preferred way of calling d2i_* functions X-Git-Tag: OpenSSL_1_0_2a~65 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4d2207f097ebd50d3f23568b013539930bbdf910;p=oweals%2Fopenssl.git Remove pointless free, and use preferred way of calling d2i_* functions Reviewed-by: Emilia Käsper --- 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; }