Clean-up Managed Proxy state in PT tests.

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.
This commit is contained in:
Alexander Færøy 2023-07-21 02:53:12 +02:00 committed by David Goulet
parent 3c8035b452
commit 1941f25f4c

View File

@ -31,6 +31,9 @@ reset_mp(managed_proxy_t *mp)
mp->conf_state = PT_PROTO_LAUNCHED; mp->conf_state = PT_PROTO_LAUNCHED;
SMARTLIST_FOREACH(mp->transports, transport_t *, t, transport_free(t)); SMARTLIST_FOREACH(mp->transports, transport_t *, t, transport_free(t));
smartlist_clear(mp->transports); smartlist_clear(mp->transports);
tor_free(mp->version);
tor_free(mp->implementation);
} }
static void static void