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

[tor-commits] [tor/master] Remove a needless check in channel_tls_handle_incoming



commit 040b478692c2355515eec626044ea2e3c37ca9c5
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Feb 7 12:01:16 2014 -0500

    Remove a needless check in channel_tls_handle_incoming
    
    This patch removes an "if (chan)" that occurred at a place where
    chan was definitely non-NULL.  Having it there made some static
    analysis tools conclude that we were up to shenanigans.
    
    This resolves #9979.
---
 src/or/channeltls.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index e76bae3..42d6874 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -287,8 +287,8 @@ channel_tls_handle_incoming(or_connection_t *orconn)
   if (is_local_addr(&(TO_CONN(orconn)->addr))) channel_mark_local(chan);
   channel_mark_incoming(chan);
 
-  /* If we got one, we should register it */
-  if (chan) channel_register(chan);
+  /* Register it */
+  channel_register(chan);
 
   return chan;
 }

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