[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Fix unit test memory leak in certs_ok_ed25519.



commit 759154b1ad8b2b5fabf09cb1dde93177c65d05a8
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Jul 5 15:42:25 2017 -0400

    Fix unit test memory leak in certs_ok_ed25519.
    
    Fixes bug 22803; bugfix on 0.3.0.1-alpha.
---
 changes/bug22803               | 3 +++
 src/test/test_link_handshake.c | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug22803 b/changes/bug22803
new file mode 100644
index 0000000..80b4b9f
--- /dev/null
+++ b/changes/bug22803
@@ -0,0 +1,3 @@
+  o Minor bugfixes (unit tests):
+    - Fix a memory leak in the link-handshake/certs_ok_ed25519 test.
+      Fixes bug 22803; bugfix on 0.3.0.1-alpha.
diff --git a/src/test/test_link_handshake.c b/src/test/test_link_handshake.c
index d81f9e8..467bba3 100644
--- a/src/test/test_link_handshake.c
+++ b/src/test/test_link_handshake.c
@@ -241,6 +241,7 @@ test_link_handshake_certs_ok(void *arg)
   }
   channel_tls_process_certs_cell(cell2, chan1);
   mock_peer_cert_expect_tortls = NULL;
+  tor_x509_cert_free(mock_peer_cert);
   mock_peer_cert = NULL;
 
   tor_assert(c1->handshake_state->authenticated);
@@ -304,7 +305,8 @@ test_link_handshake_certs_ok(void *arg)
   UNMOCK(tor_tls_get_peer_cert);
   UNMOCK(tor_tls_get_own_cert);
   tor_x509_cert_free(mock_own_cert);
-  mock_own_cert = NULL;
+  tor_x509_cert_free(mock_peer_cert);
+  mock_own_cert = mock_peer_cert = NULL;
   memset(c1->identity_digest, 0, sizeof(c1->identity_digest));
   memset(c2->identity_digest, 0, sizeof(c2->identity_digest));
   connection_free_(TO_CONN(c1));



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits