summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-10-21 14:30:34 -0400
committerNick Mathewson <nickm@torproject.org>2015-10-21 14:30:34 -0400
commit79b3c4a8a3c42ef8302e7ab8d5a873a47826f77f (patch)
tree367e78ce914951ad51d40f8d33f6f8c663989830 /src
parent13ff8e31bacc249c3d899387cbdc7cecca0ad8a3 (diff)
downloadtor-79b3c4a8a3c42ef8302e7ab8d5a873a47826f77f.tar.gz
tor-79b3c4a8a3c42ef8302e7ab8d5a873a47826f77f.zip
Yet more memory leaks closed in test_tortls
Diffstat (limited to 'src')
-rw-r--r--src/test/test_tortls.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index c1d1addde1..4d92e1737d 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -897,6 +897,9 @@ test_tortls_classify_client_ciphers(void *ignored)
done:
sk_SSL_CIPHER_free(ciphers);
+ SSL_free(tls->ssl);
+ tor_free(tls);
+ SSL_CTX_free(ctx);
}
#endif
@@ -1299,6 +1302,7 @@ test_tortls_received_v3_certificate(void *ignored)
tor_tls_t *tls;
X509 *validCert = read_cert_from(validCertString);
X509_NAME *subject=NULL, *issuer=NULL;
+ EVP_PKEY *key = NULL;
tls = tor_malloc_zero(sizeof(tor_tls_t));
tls->ssl = tor_malloc_zero(sizeof(SSL));
@@ -1354,7 +1358,7 @@ test_tortls_received_v3_certificate(void *ignored)
ret = tor_tls_received_v3_certificate(tls);
tt_int_op(ret, OP_EQ, 0);
- EVP_PKEY *key = X509_get_pubkey(validCert);
+ key = X509_get_pubkey(validCert);
key->type = 5;
ret = tor_tls_received_v3_certificate(tls);
tt_int_op(ret, OP_EQ, 1);
@@ -1370,6 +1374,9 @@ test_tortls_received_v3_certificate(void *ignored)
tor_free(tls->ssl->session);
tor_free(tls->ssl);
tor_free(tls);
+ X509_free(validCert);
+ if (key)
+ EVP_PKEY_free(key);
}
#endif