Remove pointless free, and use preferred way of calling d2i_* functions
(Imported from upstream's 535bc8faf69dc4ff39e2ee99195b268cf99b9569) Change-Id: Ia5abf4dce9dc8cdf5a9b77a3e360a40b5f815adf Reviewed-on: https://boringssl-review.googlesource.com/3672 Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
parent
29b50eab6c
commit
5ae21bc02b
@ -290,16 +290,9 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const uint8_t **in, long len) {
|
||||
EC_KEY *ret = NULL;
|
||||
EC_PRIVATEKEY *priv_key = NULL;
|
||||
|
||||
priv_key = EC_PRIVATEKEY_new();
|
||||
if (priv_key == NULL) {
|
||||
OPENSSL_PUT_ERROR(EC, d2i_ECPrivateKey, ERR_R_MALLOC_FAILURE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
priv_key = d2i_EC_PRIVATEKEY(&priv_key, in, len);
|
||||
priv_key = d2i_EC_PRIVATEKEY(NULL, in, len);
|
||||
if (priv_key == NULL) {
|
||||
OPENSSL_PUT_ERROR(EC, d2i_ECPrivateKey, ERR_R_EC_LIB);
|
||||
EC_PRIVATEKEY_free(priv_key);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user