From dfcb9daaaf680b1e7c9dc2ad85326e038815e213 Mon Sep 17 00:00:00 2001 From: logan Date: Sun, 13 Jul 2014 15:47:51 +0000 Subject: [PATCH] Fix memory leak. OK from beck@ and miod@ --- lib/libcrypto/ec/ec_ameth.c | 3 ++- lib/libssl/src/crypto/ec/ec_ameth.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/ec/ec_ameth.c b/lib/libcrypto/ec/ec_ameth.c index c201815621a..6b4dfdec46a 100644 --- a/lib/libcrypto/ec/ec_ameth.c +++ b/lib/libcrypto/ec/ec_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_ameth.c,v 1.12 2014/07/12 16:03:37 miod Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.13 2014/07/13 15:47:51 logan Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -373,6 +373,7 @@ ec_bits(const EVP_PKEY * pkey) } group = EC_KEY_get0_group(pkey->pkey.ec); if (!EC_GROUP_get_order(group, order, NULL)) { + BN_free(order); ERR_clear_error(); return 0; } diff --git a/lib/libssl/src/crypto/ec/ec_ameth.c b/lib/libssl/src/crypto/ec/ec_ameth.c index c201815621a..6b4dfdec46a 100644 --- a/lib/libssl/src/crypto/ec/ec_ameth.c +++ b/lib/libssl/src/crypto/ec/ec_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_ameth.c,v 1.12 2014/07/12 16:03:37 miod Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.13 2014/07/13 15:47:51 logan Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -373,6 +373,7 @@ ec_bits(const EVP_PKEY * pkey) } group = EC_KEY_get0_group(pkey->pkey.ec); if (!EC_GROUP_get_order(group, order, NULL)) { + BN_free(order); ERR_clear_error(); return 0; } -- 2.20.1