From 997edad64f993d3a9ef21fd90492fd9b2ba1b7ba Mon Sep 17 00:00:00 2001 From: logan <> Date: Thu, 17 Jul 2014 07:13:02 +0000 Subject: Free sktmp when it's no longer needed. By doing so, we fix a bunch of memory leaks. From miod@ OK from miod@ and guenther@ --- src/lib/libcrypto/x509/x509_vfy.c | 6 ++++-- src/lib/libssl/src/crypto/x509/x509_vfy.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 0b0a2c56d2..ae8484a885 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.c,v 1.36 2014/07/12 17:35:23 deraadt Exp $ */ +/* $OpenBSD: x509_vfy.c,v 1.37 2014/07/17 07:13:02 logan Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -230,7 +230,9 @@ X509_verify_cert(X509_STORE_CTX *ctx) } break; } - + sk_X509_free(sktmp); + sktmp = NULL; + /* at this point, chain should contain a list of untrusted * certificates. We now need to add at least one trusted one, * if possible, otherwise we complain. */ diff --git a/src/lib/libssl/src/crypto/x509/x509_vfy.c b/src/lib/libssl/src/crypto/x509/x509_vfy.c index 0b0a2c56d2..ae8484a885 100644 --- a/src/lib/libssl/src/crypto/x509/x509_vfy.c +++ b/src/lib/libssl/src/crypto/x509/x509_vfy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.c,v 1.36 2014/07/12 17:35:23 deraadt Exp $ */ +/* $OpenBSD: x509_vfy.c,v 1.37 2014/07/17 07:13:02 logan Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -230,7 +230,9 @@ X509_verify_cert(X509_STORE_CTX *ctx) } break; } - + sk_X509_free(sktmp); + sktmp = NULL; + /* at this point, chain should contain a list of untrusted * certificates. We now need to add at least one trusted one, * if possible, otherwise we complain. */ -- cgit v1.2.3-55-g6feb