summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libcrypto/ec/ec_lib.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c
index 2b5abbd4bbf..4842ff2589d 100644
--- a/lib/libcrypto/ec/ec_lib.c
+++ b/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_lib.c,v 1.20 2015/10/13 15:25:18 jsing Exp $ */
+/* $OpenBSD: ec_lib.c,v 1.21 2016/08/31 10:06:04 beck Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
@@ -233,24 +233,13 @@ EC_GROUP *
EC_GROUP_dup(const EC_GROUP * a)
{
EC_GROUP *t = NULL;
- int ok = 0;
- if (a == NULL)
- return NULL;
-
- if ((t = EC_GROUP_new(a->meth)) == NULL)
- return (NULL);
- if (!EC_GROUP_copy(t, a))
- goto err;
-
- ok = 1;
-
-err:
- if (!ok) {
+ if ((a != NULL) && ((t = EC_GROUP_new(a->meth)) != NULL) &&
+ (!EC_GROUP_copy(t, a))) {
EC_GROUP_free(t);
- return NULL;
- } else
- return t;
+ t = NULL;
+ }
+ return t;
}