Fix a coupole of coverity complaints.

This commit is contained in:
Nick Mathewson 2016-09-09 15:29:57 -04:00
parent 4c55e8a58f
commit 75a7997148
2 changed files with 4 additions and 6 deletions

View File

@ -355,10 +355,8 @@ test_pick_circid(void *arg)
} }
done: done:
if (chan1) circuitmux_free(chan1->cmux);
circuitmux_free(chan1->cmux); circuitmux_free(chan2->cmux);
if (chan2)
circuitmux_free(chan2->cmux);
tor_free(chan1); tor_free(chan1);
tor_free(chan2); tor_free(chan2);
bitarray_free(ba); bitarray_free(ba);

View File

@ -113,11 +113,11 @@ test_relay_append_cell_to_circuit_queue(void *arg)
done: done:
tor_free(cell); tor_free(cell);
cell_queue_clear(&orcirc->base_.n_chan_cells);
cell_queue_clear(&orcirc->p_chan_cells);
if (orcirc) { if (orcirc) {
circuitmux_detach_circuit(nchan->cmux, TO_CIRCUIT(orcirc)); circuitmux_detach_circuit(nchan->cmux, TO_CIRCUIT(orcirc));
circuitmux_detach_circuit(pchan->cmux, TO_CIRCUIT(orcirc)); circuitmux_detach_circuit(pchan->cmux, TO_CIRCUIT(orcirc));
cell_queue_clear(&orcirc->base_.n_chan_cells);
cell_queue_clear(&orcirc->p_chan_cells);
} }
tor_free(orcirc); tor_free(orcirc);
free_fake_channel(nchan); free_fake_channel(nchan);