diff options
author | claudio <> | 2017-05-16 05:52:52 +0000 |
---|---|---|
committer | claudio <> | 2017-05-16 05:52:52 +0000 |
commit | cca2399941eaa626992a0ec066ba0ec955059bb4 (patch) | |
tree | 1d40e68b2d6c330fe3c05296f943a625e129eeb6 /src | |
parent | 04c0c551ed81eb6e86410a8eef32540aab78c494 (diff) | |
download | openbsd-cca2399941eaa626992a0ec066ba0ec955059bb4.tar.gz openbsd-cca2399941eaa626992a0ec066ba0ec955059bb4.tar.bz2 openbsd-cca2399941eaa626992a0ec066ba0ec955059bb4.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 'src')
-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); |