diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-26 11:28:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-26 11:28:39 -0400 |
commit | b60782b6d66de0853320e9a76f0dd9e25e0ec142 (patch) | |
tree | ff40afe4c40c08cb55878fdc84306527e45e1e04 /src/test/test_pt.c | |
parent | b11ab0d91dce127096275e472460cae21b30b39c (diff) | |
download | tor-b60782b6d66de0853320e9a76f0dd9e25e0ec142.tar.gz tor-b60782b6d66de0853320e9a76f0dd9e25e0ec142.zip |
Fix numerous leaks in test_pt.c
I didn't find a managed_proxy_free() function any place; shouldn't
there be one?
Diffstat (limited to 'src/test/test_pt.c')
-rw-r--r-- | src/test/test_pt.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/test/test_pt.c b/src/test/test_pt.c index 3277921052..f71627df1e 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) \ |