diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-12-22 11:13:01 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-12-22 11:13:01 -0500 |
commit | 13f26f41e469ae2fa5d2249c532f7f515195a2a0 (patch) | |
tree | c59de8f13db8b2268cc2d1daad86b57ecd2926d6 /src/test/test_channel.c | |
parent | ec07c3c5c5c4afe19816b1d5363d9b9acd4c484c (diff) | |
download | tor-13f26f41e469ae2fa5d2249c532f7f515195a2a0.tar.gz tor-13f26f41e469ae2fa5d2249c532f7f515195a2a0.zip |
Fix some coverity issues in the unit tests
Diffstat (limited to 'src/test/test_channel.c')
-rw-r--r-- | src/test/test_channel.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/test_channel.c b/src/test/test_channel.c index f882b99906..b1f1bdb435 100644 --- a/src/test/test_channel.c +++ b/src/test/test_channel.c @@ -1566,12 +1566,15 @@ test_channel_write(void *arg) old_count = test_cells_written; channel_write_cell(ch, cell); + cell = NULL; tt_assert(test_cells_written == old_count + 1); channel_write_var_cell(ch, var_cell); + var_cell = NULL; tt_assert(test_cells_written == old_count + 2); channel_write_packed_cell(ch, packed_cell); + packed_cell = NULL; tt_assert(test_cells_written == old_count + 3); /* Now we test queueing; tell it not to accept cells */ @@ -1632,15 +1635,18 @@ test_channel_write(void *arg) cell = tor_malloc_zero(sizeof(cell_t)); make_fake_cell(cell); channel_write_cell(ch, cell); + cell = NULL; tt_assert(test_cells_written == old_count); var_cell = tor_malloc_zero(sizeof(var_cell_t) + CELL_PAYLOAD_SIZE); make_fake_var_cell(var_cell); channel_write_var_cell(ch, var_cell); + var_cell = NULL; tt_assert(test_cells_written == old_count); packed_cell = packed_cell_new(); channel_write_packed_cell(ch, packed_cell); + packed_cell = NULL; tt_assert(test_cells_written == old_count); #ifdef ENABLE_MEMPOOLS @@ -1649,7 +1655,9 @@ test_channel_write(void *arg) done: tor_free(ch); - + tor_free(var_cell); + tor_free(cell); + packed_cell_free(packed_cell); return; } |