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

[or-cvs] r17809: {tor} coverity thinks it's dumb to check networkstatus_v2_list in (tor/trunk/src/or)



Author: nickm
Date: 2008-12-29 09:06:47 -0500 (Mon, 29 Dec 2008)
New Revision: 17809

Modified:
   tor/trunk/src/or/routerlist.c
Log:
coverity thinks it's dumb to check networkstatus_v2_list in one place and not another.  Coverity has a point, even though the check may be redundant. CID 361.

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2008-12-29 04:01:58 UTC (rev 17808)
+++ tor/trunk/src/or/routerlist.c	2008-12-29 14:06:47 UTC (rev 17809)
@@ -3265,7 +3265,7 @@
 
   cutoff = now - OLD_ROUTER_DESC_MAX_AGE;
   /* Build a list of all the descriptors that _anybody_ lists. */
-  if (caches) {
+  if (caches && networkstatus_v2_list) {
     SMARTLIST_FOREACH(networkstatus_v2_list, networkstatus_v2_t *, ns,
     {
       /* XXXX The inner loop here gets pretty expensive, and actually shows up