diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-26 00:12:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-26 00:12:39 -0400 |
commit | dc0fcbd8121065707274ed22cf8d25c92c3ea80e (patch) | |
tree | 6068a709928141fd9c59f35431a2c058263a78a4 /src | |
parent | 3fa296ce28ea875877ac2725dfd213e176881964 (diff) | |
download | tor-dc0fcbd8121065707274ed22cf8d25c92c3ea80e.tar tor-dc0fcbd8121065707274ed22cf8d25c92c3ea80e.tar.gz |
Fix memory leaks in test_cntev_append_cell_stats
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test_controller_events.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/test/test_controller_events.c b/src/test/test_controller_events.c index 3a9aeca2f..888f228ed 100644 --- a/src/test/test_controller_events.c +++ b/src/test/test_controller_events.c @@ -148,6 +148,7 @@ static void test_cntev_append_cell_stats(void *arg) { smartlist_t *event_parts; + char *cp = NULL; const char *key = "Z"; uint64_t include_if_non_zero[CELL_COMMAND_MAX_ + 1], number_to_include[CELL_COMMAND_MAX_ + 1]; @@ -178,7 +179,9 @@ test_cntev_append_cell_stats(void *arg) append_cell_stats_by_command(event_parts, key, include_if_non_zero, number_to_include); - tt_str_op("Z=relay:1", ==, smartlist_pop_last(event_parts)); + cp = smartlist_pop_last(event_parts); + tt_str_op("Z=relay:1", ==, cp); + tor_free(cp); /* Add four CREATE cells. */ include_if_non_zero[CELL_CREATE] = 3; @@ -186,10 +189,11 @@ test_cntev_append_cell_stats(void *arg) append_cell_stats_by_command(event_parts, key, include_if_non_zero, number_to_include); - tt_str_op("Z=create:4,relay:1", ==, smartlist_pop_last(event_parts)); + cp = smartlist_pop_last(event_parts); + tt_str_op("Z=create:4,relay:1", ==, cp); done: - ; + tor_free(cp); } static void |