diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index 7b2bad45b4..378261b946 100644 --- a/src/lib/libcrypto/ec/ec_ameth.c +++ b/src/lib/libcrypto/ec/ec_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_ameth.c,v 1.67 2024/04/18 11:56:53 tb Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.68 2024/05/10 05:12:03 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -173,6 +173,7 @@ eckey_from_object(const ASN1_OBJECT *aobj, EC_KEY **out_eckey) | |||
173 | { | 173 | { |
174 | int nid; | 174 | int nid; |
175 | 175 | ||
176 | EC_KEY_free(*out_eckey); | ||
176 | *out_eckey = NULL; | 177 | *out_eckey = NULL; |
177 | 178 | ||
178 | if ((nid = OBJ_obj2nid(aobj)) == NID_undef) | 179 | if ((nid = OBJ_obj2nid(aobj)) == NID_undef) |
@@ -206,6 +207,7 @@ eckey_to_params(EC_KEY *eckey, int *out_type, void **out_val) | |||
206 | static int | 207 | static int |
207 | eckey_from_params(int ptype, const void *pval, EC_KEY **out_eckey) | 208 | eckey_from_params(int ptype, const void *pval, EC_KEY **out_eckey) |
208 | { | 209 | { |
210 | EC_KEY_free(*out_eckey); | ||
209 | *out_eckey = NULL; | 211 | *out_eckey = NULL; |
210 | 212 | ||
211 | if (ptype == V_ASN1_SEQUENCE) | 213 | if (ptype == V_ASN1_SEQUENCE) |