summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index 2b5abbd4bb..3894a7b9f0 100644
--- a/src/lib/libcrypto/ec/ec_lib.c
+++ b/src/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_lib.c,v 1.20 2015/10/13 15:25:18 jsing Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.21 2016/09/03 12:00:24 beck Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -235,22 +235,12 @@ EC_GROUP_dup(const EC_GROUP * a)
235 EC_GROUP *t = NULL; 235 EC_GROUP *t = NULL;
236 int ok = 0; 236 int ok = 0;
237 237
238 if (a == NULL) 238 if ((a != NULL) && ((t = EC_GROUP_new(a->meth)) != NULL) &&
239 return NULL; 239 (!EC_GROUP_copy(t, a))) {
240
241 if ((t = EC_GROUP_new(a->meth)) == NULL)
242 return (NULL);
243 if (!EC_GROUP_copy(t, a))
244 goto err;
245
246 ok = 1;
247
248err:
249 if (!ok) {
250 EC_GROUP_free(t); 240 EC_GROUP_free(t);
251 return NULL; 241 t = NULL;
252 } else 242 }
253 return t; 243 return t;
254} 244}
255 245
256 246