aboutsummaryrefslogtreecommitdiff
path: root/src/or/replaycache.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2013-07-16 06:01:50 -0700
committerAndrea Shepard <andrea@torproject.org>2013-07-16 06:01:50 -0700
commit9b3a166b44267fb93ab4f2f406bfd1a308118ea6 (patch)
tree20d135e6d775035787aa5561f58e18101a2e2e60 /src/or/replaycache.c
parentd1059a936644f1a3c274f97218c7224622f212df (diff)
downloadtor-9b3a166b44267fb93ab4f2f406bfd1a308118ea6.tar
tor-9b3a166b44267fb93ab4f2f406bfd1a308118ea6.tar.gz
Eliminate an impossible case in replaycache_scrub_if_needed_internal()
Diffstat (limited to 'src/or/replaycache.c')
-rw-r--r--src/or/replaycache.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/or/replaycache.c b/src/or/replaycache.c
index f136072f6..122efb703 100644
--- a/src/or/replaycache.c
+++ b/src/or/replaycache.c
@@ -134,7 +134,6 @@ replaycache_scrub_if_needed_internal(time_t present, replaycache_t *r)
const char *digest;
void *valp;
time_t *access_time;
- char scrub_this;
/* sanity check */
if (!r || !(r->digests_seen)) {
@@ -152,20 +151,10 @@ replaycache_scrub_if_needed_internal(time_t present, replaycache_t *r)
/* okay, scrub time */
itr = digestmap_iter_init(r->digests_seen);
while (!digestmap_iter_done(itr)) {
- scrub_this = 0;
digestmap_iter_get(itr, &digest, &valp);
access_time = (time_t *)valp;
- if (access_time) {
- /* aged out yet? */
- if (*access_time < present - r->horizon) scrub_this = 1;
- } else {
- /* Buh? Get rid of it, anyway */
- log_info(LD_BUG, "replaycache_scrub_if_needed_internal() saw a NULL"
- " entry in the digestmap.");
- scrub_this = 1;
- }
-
- if (scrub_this) {
+ /* aged out yet? */
+ if (*access_time < present - r->horizon) {
/* Advance the iterator and remove this one */
itr = digestmap_iter_next_rmv(r->digests_seen, itr);
/* Free the value removed */