diff options
| author | logan <> | 2014-07-17 07:13:02 +0000 |
|---|---|---|
| committer | logan <> | 2014-07-17 07:13:02 +0000 |
| commit | 33f77d4fdf18653691e206e0fa4055a8f5ef9fe8 (patch) | |
| tree | 4246af99972856498156fcfa6b7e57a43baaa317 /src | |
| parent | 7e89b2633ecbbed3b5ee3f7cba473342b750e95f (diff) | |
| download | openbsd-33f77d4fdf18653691e206e0fa4055a8f5ef9fe8.tar.gz openbsd-33f77d4fdf18653691e206e0fa4055a8f5ef9fe8.tar.bz2 openbsd-33f77d4fdf18653691e206e0fa4055a8f5ef9fe8.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 '')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 6 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/x509/x509_vfy.c | 6 |
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. */ |
