summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
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;
}