]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix duplicated if condition in connection.c
authorDavid Goulet <dgoulet@torproject.org>
Thu, 25 Aug 2016 18:52:25 +0000 (14:52 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Thu, 25 Aug 2016 18:52:28 +0000 (14:52 -0400)
Furthermore, fix a test that could returned an uninitialized value.

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/or/connection.c
src/test/test_oos.c

index 9b583f424384c64ad02bfe0e693d28a1e7caa009..e3560af4c5141d6266e6eba9eda1aa416ac39100 100644 (file)
@@ -4511,7 +4511,7 @@ oos_victim_comparator_for_orconns(or_connection_t *a, or_connection_t *b)
   b_circs = connection_or_get_num_circuits(b);
 
   if (a_circs < b_circs) return -1;
-  else if (b_circs > a_circs) return 1;
+  else if (a_circs > b_circs) return 1;
   else return 0;
 }
 
index 9451c5c53746d040a51abcc6446ebb4f6ca04a29..3afb68b27acccd2365dd073bc6825f65bea94edf 100644 (file)
@@ -67,7 +67,7 @@ static int pick_oos_mock_last_n = 0;
 static smartlist_t *
 pick_oos_victims_mock(int n)
 {
-  smartlist_t *l;
+  smartlist_t *l = NULL;
   int i;
 
   ++pick_oos_mock_calls;