[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Yet more memory leaks closed in test_tortls
commit 79b3c4a8a3c42ef8302e7ab8d5a873a47826f77f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Wed Oct 21 14:30:34 2015 -0400
Yet more memory leaks closed in test_tortls
---
src/test/test_tortls.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index c1d1add..4d92e17 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
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits