From b11ab0d91dce127096275e472460cae21b30b39c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 26 Apr 2014 00:40:22 -0400 Subject: [PATCH] test_cntev_append_cell_stats now no longer leaks --- src/test/test_controller_events.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/test/test_controller_events.c b/src/test/test_controller_events.c index 888f228ed1..ee35239e45 100644 --- a/src/test/test_controller_events.c +++ b/src/test/test_controller_events.c @@ -194,16 +194,17 @@ test_cntev_append_cell_stats(void *arg) done: tor_free(cp); + smartlist_free(event_parts); } static void test_cntev_format_cell_stats(void *arg) { char *event_string = NULL; - origin_circuit_t *ocirc; - or_circuit_t *or_circ; + origin_circuit_t *ocirc = NULL; + or_circuit_t *or_circ = NULL; cell_stats_t *cell_stats = NULL; - channel_tls_t *n_chan, *p_chan; + channel_tls_t *n_chan=NULL, *p_chan=NULL; (void)arg; n_chan = tor_malloc_zero(sizeof(channel_tls_t)); @@ -286,6 +287,10 @@ test_cntev_format_cell_stats(void *arg) done: tor_free(cell_stats); tor_free(event_string); + tor_free(or_circ); + tor_free(ocirc); + tor_free(p_chan); + tor_free(n_chan); } #define TEST(name, flags) \