From: Nick Mathewson Date: Tue, 18 Mar 2014 13:46:39 +0000 (-0400) Subject: Fix a use-after-free in test_circuitlist.c X-Git-Tag: tor-0.2.5.4-alpha~85^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98b1aad2018b572e19d2404ea7369afa2d0c4b05;p=thirdparty%2Ftor.git Fix a use-after-free in test_circuitlist.c Found by clang-3.4 analyzers. --- diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c index 720b407659..54aa51d3c7 100644 --- a/src/test/test_circuitlist.c +++ b/src/test/test_circuitlist.c @@ -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); }