summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorLoganaden Velvindron <logan@cvs.openbsd.org>2014-06-24 05:39:30 +0000
committerLoganaden Velvindron <logan@cvs.openbsd.org>2014-06-24 05:39:30 +0000
commitc061a1c998b120e1a5dec2a4f9c8fdbf462dc276 (patch)
tree606f84629167b2ddd20423baaa57e11067c7351d /lib/libssl
parentd13e547914d793e8876d31f20b75b23905014075 (diff)
Fix memory leak.
Thanks to Brenk Cook. OK from miod@
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/src/apps/ecparam.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libssl/src/apps/ecparam.c b/lib/libssl/src/apps/ecparam.c
index bed801a6d8d..e00cb20539e 100644
--- a/lib/libssl/src/apps/ecparam.c
+++ b/lib/libssl/src/apps/ecparam.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecparam.c,v 1.20 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: ecparam.c,v 1.21 2014/06/24 05:39:29 logan Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -544,8 +544,10 @@ bad:
if (eckey == NULL)
goto end;
- if (EC_KEY_set_group(eckey, group) == 0)
+ if (EC_KEY_set_group(eckey, group) == 0) {
+ EC_KEY_free(eckey);
goto end;
+ }
if (!EC_KEY_generate_key(eckey)) {
EC_KEY_free(eckey);