tlsrp

A simple TLS reverse proxy
git clone git://nihaljere.xyz/tlsrp
Log | Files | Refs

commit 888ea50bde843a7f0d3b9b32e5e3cbed3a5f05ce
parent 0316f7e3286cbabc735b4474172b77eaad1f8cec
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Mon,  6 Jul 2020 11:55:31 -0500

removed superfluous frees

Diffstat:
Mtlsrp.c | 36++++++++++--------------------------
1 file changed, 10 insertions(+), 26 deletions(-)

diff --git a/tlsrp.c b/tlsrp.c @@ -233,51 +233,35 @@ main(int argc, char* argv[]) if (!key_path) die("need to provide key file path"); - if ((config = tls_config_new()) == NULL) { + if ((config = tls_config_new()) == NULL) die("failed to get tls config:"); - } - if (tls_config_set_protocols(config, protocols) == -1) { + if (tls_config_set_protocols(config, protocols) == -1) die("failed to set protocols:"); - } - if (tls_config_set_ciphers(config, ciphers) == -1) { + if (tls_config_set_ciphers(config, ciphers) == -1) die("failed to set ciphers:"); - } - if (tls_config_set_dheparams(config, dheparams) == -1) { + if (tls_config_set_dheparams(config, dheparams) == -1) die("failed to set dheparams:"); - } - if (tls_config_set_ecdhecurves(config, ecdhecurves) == -1) { + if (tls_config_set_ecdhecurves(config, ecdhecurves) == -1) die("failed to set ecdhecurves:"); - } - if (tls_config_set_ca_file(config, ca_path) == -1) { - tls_config_free(config); + if (tls_config_set_ca_file(config, ca_path) == -1) die("failed to load ca file:"); - } - if (tls_config_set_cert_file(config, cert_path) == -1) { - tls_config_free(config); + if (tls_config_set_cert_file(config, cert_path) == -1) die("failed to load cert file:"); - } - if (tls_config_set_key_file(config, key_path) == -1) { - tls_config_free(config); + if (tls_config_set_key_file(config, key_path) == -1) die("failed to load key file:"); - } - if ((tls_client = tls_server()) == NULL) { - tls_config_free(config); + if ((tls_client = tls_server()) == NULL) die("failed to create server context:"); - } - if ((tls_configure(tls_client, config)) == -1) { - tls_config_free(config); - tls_free(tls_client); + if ((tls_configure(tls_client, config)) == -1) die("failed to configure server:"); - } tls_config_free(config);