commit b60782b6d66de0853320e9a76f0dd9e25e0ec142 Author: Nick Mathewson nickm@torproject.org Date: Sat Apr 26 11:28:39 2014 -0400
Fix numerous leaks in test_pt.c
I didn't find a managed_proxy_free() function any place; shouldn't there be one? --- src/test/test_pt.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/test/test_pt.c b/src/test/test_pt.c index 3277921..f71627d 100644 --- a/src/test/test_pt.c +++ b/src/test/test_pt.c @@ -129,6 +129,8 @@ test_pt_parsing(void) test_assert(parse_version(line, mp) == 0);
done: + reset_mp(mp); + smartlist_free(mp->transports); tor_free(mp); }
@@ -227,6 +229,10 @@ test_pt_protocol(void) test_assert(mp->conf_state == PT_PROTO_CONFIGURED);
done: + reset_mp(mp); + smartlist_free(mp->transports); + tor_free(mp->argv[0]); + tor_free(mp->argv); tor_free(mp); }
@@ -423,7 +429,7 @@ test_pt_configure_proxy(void *arg) }
done: - tor_free(dummy_state); + or_state_free(dummy_state); UNMOCK(tor_get_lines_from_handle); UNMOCK(tor_process_handle_destroy); UNMOCK(get_or_state); @@ -433,6 +439,15 @@ test_pt_configure_proxy(void *arg) smartlist_free(controlevent_msgs); controlevent_msgs = NULL; } + if (mp->transports) { + SMARTLIST_FOREACH(mp->transports, transport_t *, t, transport_free(t)); + smartlist_free(mp->transports); + } + smartlist_free(mp->transports_to_launch); + tor_free(mp->process_handle); + tor_free(mp->argv[0]); + tor_free(mp->argv); + tor_free(mp); }
#define PT_LEGACY(name) \