summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authordoug <doug@openbsd.org>2015-03-20 03:02:51 +0000
committerdoug <doug@openbsd.org>2015-03-20 03:02:51 +0000
commitd2a2a72670f554fa0206233f888219de4891dfec (patch)
tree53f0a5333d9288aeffbe8776df9312e6ed7bbf28 /lib/libssl/src
parentFix cut & pasto in warning message; from Andre Smagin (diff)
downloadwireguard-openbsd-d2a2a72670f554fa0206233f888219de4891dfec.tar.xz
wireguard-openbsd-d2a2a72670f554fa0206233f888219de4891dfec.zip
Fix a memory leak in an error path.
From OpenSSL commit 5e5d53d341fd9a9b9cc0a58eb3690832ca7a511f. ok guenther@, logan@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/ec/ec_asn1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libssl/src/crypto/ec/ec_asn1.c b/lib/libssl/src/crypto/ec/ec_asn1.c
index f01008ec438..e1d3f6bad7d 100644
--- a/lib/libssl/src/crypto/ec/ec_asn1.c
+++ b/lib/libssl/src/crypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_asn1.c,v 1.13 2015/03/19 14:00:22 tedu Exp $ */
+/* $OpenBSD: ec_asn1.c,v 1.14 2015/03/20 03:02:51 doug Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -1235,6 +1235,8 @@ d2i_ECParameters(EC_KEY ** a, const unsigned char **in, long len)
if (!d2i_ECPKParameters(&ret->group, in, len)) {
ECerr(EC_F_D2I_ECPARAMETERS, ERR_R_EC_LIB);
+ if (a == NULL || *a != ret)
+ EC_KEY_free(ret);
return NULL;
}