[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Fix a coupole of coverity complaints.



commit 75a7997148c55515a5d1c029a0ab5b46341a4e18
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Sep 9 15:29:57 2016 -0400

    Fix a coupole of coverity complaints.
---
 src/test/test_circuitlist.c | 6 ++----
 src/test/test_relay.c       | 4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c
index b233e99..e996c42 100644
--- a/src/test/test_circuitlist.c
+++ b/src/test/test_circuitlist.c
@@ -355,10 +355,8 @@ test_pick_circid(void *arg)
   }
 
  done:
-  if (chan1)
-    circuitmux_free(chan1->cmux);
-  if (chan2)
-    circuitmux_free(chan2->cmux);
+  circuitmux_free(chan1->cmux);
+  circuitmux_free(chan2->cmux);
   tor_free(chan1);
   tor_free(chan2);
   bitarray_free(ba);
diff --git a/src/test/test_relay.c b/src/test/test_relay.c
index 29016e4..4713c79 100644
--- a/src/test/test_relay.c
+++ b/src/test/test_relay.c
@@ -113,11 +113,11 @@ test_relay_append_cell_to_circuit_queue(void *arg)
 
  done:
   tor_free(cell);
-  cell_queue_clear(&orcirc->base_.n_chan_cells);
-  cell_queue_clear(&orcirc->p_chan_cells);
   if (orcirc) {
     circuitmux_detach_circuit(nchan->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);
   free_fake_channel(nchan);

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits