]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Clean-up Managed Proxy state in PT tests.
authorAlexander Færøy <ahf@torproject.org>
Fri, 21 Jul 2023 00:53:12 +0000 (02:53 +0200)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 18 Jun 2024 19:15:32 +0000 (15:15 -0400)
This patch makes sure we clean up our version and implementation fields
in our Managed Proxy struct after each test run.

This was detected by LeakSanitizer.

See: tpo/core/tor#11101.

src/test/test_pt.c

index 29146a41933fb872bf3916f2036c5506fc986604..62519a235ffb8a35a9e2bb195c8d5d14c6f3a4e5 100644 (file)
@@ -31,6 +31,9 @@ reset_mp(managed_proxy_t *mp)
   mp->conf_state = PT_PROTO_LAUNCHED;
   SMARTLIST_FOREACH(mp->transports, transport_t *, t, transport_free(t));
   smartlist_clear(mp->transports);
+
+  tor_free(mp->version);
+  tor_free(mp->implementation);
 }
 
 static void