summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorlogan <>2014-07-17 07:13:02 +0000
committerlogan <>2014-07-17 07:13:02 +0000
commit997edad64f993d3a9ef21fd90492fd9b2ba1b7ba (patch)
tree4246af99972856498156fcfa6b7e57a43baaa317 /src/lib
parent1cfb5285ba49777aca7d73ffbf7e71f49fbb9948 (diff)
downloadopenbsd-997edad64f993d3a9ef21fd90492fd9b2ba1b7ba.tar.gz
openbsd-997edad64f993d3a9ef21fd90492fd9b2ba1b7ba.tar.bz2
openbsd-997edad64f993d3a9ef21fd90492fd9b2ba1b7ba.zip
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@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c6
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_vfy.c6
2 files changed, 8 insertions, 4 deletions
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 @@
1/* $OpenBSD: x509_vfy.c,v 1.36 2014/07/12 17:35:23 deraadt Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.37 2014/07/17 07:13:02 logan Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -230,7 +230,9 @@ X509_verify_cert(X509_STORE_CTX *ctx)
230 } 230 }
231 break; 231 break;
232 } 232 }
233 233 sk_X509_free(sktmp);
234 sktmp = NULL;
235
234 /* at this point, chain should contain a list of untrusted 236 /* at this point, chain should contain a list of untrusted
235 * certificates. We now need to add at least one trusted one, 237 * certificates. We now need to add at least one trusted one,
236 * if possible, otherwise we complain. */ 238 * 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 @@
1/* $OpenBSD: x509_vfy.c,v 1.36 2014/07/12 17:35:23 deraadt Exp $ */ 1/* $OpenBSD: x509_vfy.c,v 1.37 2014/07/17 07:13:02 logan Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -230,7 +230,9 @@ X509_verify_cert(X509_STORE_CTX *ctx)
230 } 230 }
231 break; 231 break;
232 } 232 }
233 233 sk_X509_free(sktmp);
234 sktmp = NULL;
235
234 /* at this point, chain should contain a list of untrusted 236 /* at this point, chain should contain a list of untrusted
235 * certificates. We now need to add at least one trusted one, 237 * certificates. We now need to add at least one trusted one,
236 * if possible, otherwise we complain. */ 238 * if possible, otherwise we complain. */