summaryrefslogtreecommitdiff
path: root/src/lib/tls/tortls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-04 14:37:42 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-04 14:52:35 -0400
commit274efb126324f3f8a7e98b15a697c0038a9803d0 (patch)
tree06b7ab7f8442c1885b39bbb571d0d59b99a00b61 /src/lib/tls/tortls.c
parentad94d43fc50525e8814b6e99f78d4b9635fa80ca (diff)
downloadtor-274efb126324f3f8a7e98b15a697c0038a9803d0.tar.gz
tor-274efb126324f3f8a7e98b15a697c0038a9803d0.zip
Use FREE_AND_NULL for impl types
Diffstat (limited to 'src/lib/tls/tortls.c')
-rw-r--r--src/lib/tls/tortls.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/lib/tls/tortls.c b/src/lib/tls/tortls.c
index 64c26f7e14..923b0db4c4 100644
--- a/src/lib/tls/tortls.c
+++ b/src/lib/tls/tortls.c
@@ -335,12 +335,9 @@ tor_tls_context_init_certificates(tor_tls_context_t *result,
tor_free(nickname);
tor_free(nn2);
- if (cert)
- tor_x509_cert_impl_free_(cert);
- if (idcert)
- tor_x509_cert_impl_free_(idcert);
- if (authcert)
- tor_x509_cert_impl_free_(authcert);
+ tor_x509_cert_impl_free(cert);
+ tor_x509_cert_impl_free(idcert);
+ tor_x509_cert_impl_free(authcert);
crypto_pk_free(rsa);
crypto_pk_free(rsa_auth);
@@ -379,7 +376,7 @@ tor_tls_free_(tor_tls_t *tls)
size_t r,w;
tor_tls_get_n_raw_bytes(tls,&r,&w); /* ensure written_by_tls is updated */
}
- tor_tls_impl_free_(tls->ssl);
+ tor_tls_impl_free(tls->ssl);
tls->ssl = NULL;
#ifdef ENABLE_OPENSSL
tls->negotiated_callback = NULL;
@@ -424,10 +421,8 @@ tor_tls_verify(int severity, tor_tls_t *tls, crypto_pk_t **identity)
rv = 0;
done:
- if (cert)
- tor_x509_cert_impl_free_(cert);
- if (id_cert)
- tor_x509_cert_impl_free_(id_cert);
+ tor_x509_cert_impl_free(cert);
+ tor_x509_cert_impl_free(id_cert);
tor_x509_cert_free(peer_x509);
tor_x509_cert_free(id_x509);