]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a use-after-free in test_circuitlist.c
authorNick Mathewson <nickm@torproject.org>
Tue, 18 Mar 2014 13:46:39 +0000 (09:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 18 Mar 2014 13:47:13 +0000 (09:47 -0400)
Found by clang-3.4 analyzers.

src/test/test_circuitlist.c

index 720b407659e35bbbbefcffd4f5e622f9123809c7..54aa51d3c7ed8e8e081103ea8d52595d899ba5f8 100644 (file)
@@ -150,13 +150,13 @@ test_clist_maps(void *arg)
   tt_assert(! circuit_id_in_use_on_channel(100, ch1));
 
  done:
-  tor_free(ch1);
-  tor_free(ch2);
-  tor_free(ch3);
   if (or_c1)
     circuit_free(TO_CIRCUIT(or_c1));
   if (or_c2)
     circuit_free(TO_CIRCUIT(or_c2));
+  tor_free(ch1);
+  tor_free(ch2);
+  tor_free(ch3);
   UNMOCK(circuitmux_attach_circuit);
   UNMOCK(circuitmux_detach_circuit);
 }