[tor-commits] [tor/master] cid 432: Remove dead code if we don't handle a consensus

nickm at torproject.org nickm at torproject.org
Mon Dec 5 16:55:57 UTC 2011


commit 60c330a2515494a88aaae948e0e1ddfac3e8c904
Author: Sebastian Hahn <sebastian at torproject.org>
Date:   Fri Dec 2 16:35:45 2011 +0100

    cid 432: Remove dead code if we don't handle a consensus
    
    Bugfix on 0.2.3.1, fixes the second half of bug 4637.
---
 changes/bug4637    |    3 +++
 src/or/directory.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/changes/bug4637 b/changes/bug4637
new file mode 100644
index 0000000..bf2ba93
--- /dev/null
+++ b/changes/bug4637
@@ -0,0 +1,3 @@
+  o Code simplifications and refactoring:
+    - Remove some dead code spotted by coverity. Fixes cid 432.
+      Bugfix on 0.2.3.1-alpha, closes bug 4637.
diff --git a/src/or/directory.c b/src/or/directory.c
index d4abe02..12636ba 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -410,7 +410,7 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose,
     } else {
       /* Otherwise it might be a consensus we don't parse, but which we
        * do cache.  Look at the cached copy, perhaps. */
-      cached_dir_t *cd = dirserv_get_consensus(resource ? resource : "ns");
+      cached_dir_t *cd = dirserv_get_consensus(resource);
       if (cd)
         if_modified_since = cd->published + 180;
     }





More information about the tor-commits mailing list