diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2017-05-16 05:52:53 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2017-05-16 05:52:53 +0000 |
commit | fb4fdfa42e8a5c501dd5af116a40f991d3634abc (patch) | |
tree | ef5dc10a03bf67ce896cda7186aee4c17faded9e /lib | |
parent | 3144c7256071397616e31d9c91591368165f16f5 (diff) |
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 'lib')
-rw-r--r-- | lib/libtls/tls_ocsp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libtls/tls_ocsp.c b/lib/libtls/tls_ocsp.c index a7aca37a7df..13196bc1fca 100644 --- a/lib/libtls/tls_ocsp.c +++ b/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); |