diff options
| author | miod <> | 2014-07-11 15:40:32 +0000 |
|---|---|---|
| committer | miod <> | 2014-07-11 15:40:32 +0000 |
| commit | 482128d0e3f15a0d0ab6cb1f4ed58d601614d69e (patch) | |
| tree | 92977bfa3184f1b8df733c994bc8f15a483d9932 /src/lib/libcrypto/bio/bio_lib.c | |
| parent | 18bdde9865ea251e579d559e6e6a6a9e0f147088 (diff) | |
| download | openbsd-482128d0e3f15a0d0ab6cb1f4ed58d601614d69e.tar.gz openbsd-482128d0e3f15a0d0ab6cb1f4ed58d601614d69e.tar.bz2 openbsd-482128d0e3f15a0d0ab6cb1f4ed58d601614d69e.zip | |
Fix a memory leak in BIO_free() which no current BIO can trigger; OpenSSL
PR #3439 via OpenSSL trunk
Diffstat (limited to 'src/lib/libcrypto/bio/bio_lib.c')
| -rw-r--r-- | src/lib/libcrypto/bio/bio_lib.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index 41b3d31678..a2b34a2f80 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bio_lib.c,v 1.19 2014/07/11 08:44:47 jsing Exp $ */ | 1 | /* $OpenBSD: bio_lib.c,v 1.20 2014/07/11 15:40:32 miod 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 | * |
| @@ -125,9 +125,8 @@ BIO_free(BIO *a) | |||
| 125 | 125 | ||
| 126 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data); | 126 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data); |
| 127 | 127 | ||
| 128 | if ((a->method == NULL) || (a->method->destroy == NULL)) | 128 | if (a->method != NULL && a->method->destroy != NULL) |
| 129 | return (1); | 129 | a->method->destroy(a); |
| 130 | a->method->destroy(a); | ||
| 131 | free(a); | 130 | free(a); |
| 132 | return (1); | 131 | return (1); |
| 133 | } | 132 | } |
