summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/ec/ec_key.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libcrypto/ec/ec_key.c b/lib/libcrypto/ec/ec_key.c
index 1aef6343498..662a7c0f49a 100644
--- a/lib/libcrypto/ec/ec_key.c
+++ b/lib/libcrypto/ec/ec_key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_key.c,v 1.46 2024/11/08 22:10:18 tb Exp $ */
+/* $OpenBSD: ec_key.c,v 1.47 2024/11/15 08:49:07 tb Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -150,12 +150,9 @@ EC_KEY_copy(EC_KEY *dest, const EC_KEY *src)
}
}
- /*
- * XXX - if there's no priv_key on src, dest retains its probably
- * invalid priv_key. This makes no sense. Can we change this?
- */
+ BN_free(dest->priv_key);
+ dest->priv_key = NULL;
if (src->priv_key != NULL) {
- BN_free(dest->priv_key);
if ((dest->priv_key = BN_dup(src->priv_key)) == NULL)
return NULL;
}