diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-12-22 12:27:26 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-12-22 12:27:26 -0500 |
commit | 03d2df62f614f97d2b5cf52518565ce91333ba87 (patch) | |
tree | 0d9ae7750a5bfd29c886a3820306fdec97fbae78 /src/test/test_relay.c | |
parent | b94cb401d2185566e7fb52b78c5a5a6747987f99 (diff) | |
download | tor-03d2df62f614f97d2b5cf52518565ce91333ba87.tar.gz tor-03d2df62f614f97d2b5cf52518565ce91333ba87.zip |
Fix a bunch of memory leaks in the unit tests. Found with valgrind
Diffstat (limited to 'src/test/test_relay.c')
-rw-r--r-- | src/test/test_relay.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/test/test_relay.c b/src/test/test_relay.c index 38d1d96703..fbe7fafc06 100644 --- a/src/test/test_relay.c +++ b/src/test/test_relay.c @@ -111,15 +111,14 @@ test_relay_append_cell_to_circuit_queue(void *arg) /* Shut down channels */ channel_free_all(); - nchan = pchan = NULL; done: tor_free(cell); + cell_queue_clear(&orcirc->base_.n_chan_cells); + cell_queue_clear(&orcirc->p_chan_cells); tor_free(orcirc); - if (nchan && nchan->cmux) circuitmux_free(nchan->cmux); - tor_free(nchan); - if (pchan && pchan->cmux) circuitmux_free(pchan->cmux); - tor_free(pchan); + free_fake_channel(nchan); + free_fake_channel(pchan); #ifdef ENABLE_MEMPOOLS free_cell_pool(); #endif /* ENABLE_MEMPOOLS */ |