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

[tor-commits] [tor/master] Fix duplicated if condition in connection.c



commit 9e1cb3660b007e26ea84175d3695b2791c4cbd87
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Thu Aug 25 14:52:25 2016 -0400

    Fix duplicated if condition in connection.c
    
    Furthermore, fix a test that could returned an uninitialized value.
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 src/or/connection.c | 2 +-
 src/test/test_oos.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 9b583f4..e3560af 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -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;
 }
 
diff --git a/src/test/test_oos.c b/src/test/test_oos.c
index 9451c5c..3afb68b 100644
--- a/src/test/test_oos.c
+++ b/src/test/test_oos.c
@@ -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;

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