aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_tortls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-15 14:00:08 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-15 14:00:08 -0500
commita56fb58d6e1e93b95e2a060b61f3d00eab95a298 (patch)
treebbd8ff0c79de7bcd05ce9c0ed15a41deb578635b /src/test/test_tortls.c
parentefc8b2dbbfa0659405edb1e388f1f84cb8023425 (diff)
downloadtor-a56fb58d6e1e93b95e2a060b61f3d00eab95a298.tar.gz
tor-a56fb58d6e1e93b95e2a060b61f3d00eab95a298.zip
Fix some memory leaks in the unit tests
Diffstat (limited to 'src/test/test_tortls.c')
-rw-r--r--src/test/test_tortls.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index b4a3435cfa..8602d9ef15 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -145,6 +145,7 @@ test_tortls_tor_tls_new(void *data)
tt_want(tls);
tor_tls_free(tls); tls = NULL;
+ SSL_CTX_free(client_tls_context->ctx);
client_tls_context->ctx = NULL;
tls = tor_tls_new(-1, 0);
tt_assert(!tls);
@@ -1140,6 +1141,7 @@ test_tortls_check_lifetime(void *ignored)
tor_free(tls->ssl->session);
tor_free(tls->ssl);
tor_free(tls);
+ X509_free(validCert);
}
#endif
@@ -1465,6 +1467,7 @@ test_tortls_try_to_extract_certs_from_tls(void *ignored)
tt_assert(id_cert);
done:
+ sk_X509_free(sess->cert_chain);
tor_free(sess);
tor_free(tls->ssl->session);
tor_free(tls->ssl);
@@ -2166,6 +2169,7 @@ test_tortls_write(void *ignored)
done:
teardown_capture_of_logs(previous_log);
+ BIO_free(tls->ssl->rbio);
tor_free(tls->ssl);
tor_free(tls);
tor_free(method);