diff options
| author | claudio <> | 2017-05-16 05:52:52 +0000 |
|---|---|---|
| committer | claudio <> | 2017-05-16 05:52:52 +0000 |
| commit | 7ad9f2edfd93fb9172eacbbd167845c844f2e661 (patch) | |
| tree | 1d40e68b2d6c330fe3c05296f943a625e129eeb6 /src | |
| parent | f6934aa56fb216938213092fd098b1a433d4882c (diff) | |
| download | openbsd-7ad9f2edfd93fb9172eacbbd167845c844f2e661.tar.gz openbsd-7ad9f2edfd93fb9172eacbbd167845c844f2e661.tar.bz2 openbsd-7ad9f2edfd93fb9172eacbbd167845c844f2e661.zip | |
Plug a memory leak. The main_cert needs to be X509_free()ed since
SSL_get_peer_certificate() increases the ref count whereas extra_certs
do not because SSL_get_peer_cert_chain() won't increase ref counts.
OK beck@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls_ocsp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/libtls/tls_ocsp.c b/src/lib/libtls/tls_ocsp.c index a7aca37a7d..13196bc1fc 100644 --- a/src/lib/libtls/tls_ocsp.c +++ b/src/lib/libtls/tls_ocsp.c | |||
| @@ -46,6 +46,8 @@ tls_ocsp_free(struct tls_ocsp *ocsp) | |||
| 46 | if (ocsp == NULL) | 46 | if (ocsp == NULL) |
| 47 | return; | 47 | return; |
| 48 | 48 | ||
| 49 | X509_free(ocsp->main_cert); | ||
| 50 | ocsp->main_cert = NULL; | ||
| 49 | free(ocsp->ocsp_result); | 51 | free(ocsp->ocsp_result); |
| 50 | ocsp->ocsp_result = NULL; | 52 | ocsp->ocsp_result = NULL; |
| 51 | free(ocsp->ocsp_url); | 53 | free(ocsp->ocsp_url); |
