From cca2399941eaa626992a0ec066ba0ec955059bb4 Mon Sep 17 00:00:00 2001 From: claudio <> Date: Tue, 16 May 2017 05:52:52 +0000 Subject: 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@ --- src/lib/libtls/tls_ocsp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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) if (ocsp == NULL) return; + X509_free(ocsp->main_cert); + ocsp->main_cert = NULL; free(ocsp->ocsp_result); ocsp->ocsp_result = NULL; free(ocsp->ocsp_url); -- cgit v1.2.3-55-g6feb