]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a coupole of coverity complaints.
authorNick Mathewson <nickm@torproject.org>
Fri, 9 Sep 2016 19:29:57 +0000 (15:29 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 9 Sep 2016 19:29:57 +0000 (15:29 -0400)
src/test/test_circuitlist.c
src/test/test_relay.c

index b233e99328be254452673a8194b236affe32bc19..e996c42115625a87e847a2664c5024c8c8117710 100644 (file)
@@ -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);
index 29016e444bcd40d5fcdb402f30a2c10376358fea..4713c79ea5ebc96b1f402f881b850b76cfa6d6cd 100644 (file)
@@ -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);