Browse Source

Unpack a smartlist_foreach and add an assert: try to hunt #5102

Nick Mathewson 12 years ago
parent
commit
61452299d1
1 changed files with 8 additions and 8 deletions
  1. 8 8
      src/or/circuitbuild.c

+ 8 - 8
src/or/circuitbuild.c

@@ -3906,14 +3906,14 @@ entry_guard_register_connect_status(const char *digest, int succeeded,
   if (! entry_guards)
     return 0;
 
-  SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e,
-    {
-      if (tor_memeq(e->identity, digest, DIGEST_LEN)) {
-        entry = e;
-        idx = e_sl_idx;
-        break;
-      }
-    });
+  SMARTLIST_FOREACH_BEGIN(entry_guards, entry_guard_t *, e) {
+    tor_assert(e);
+    if (tor_memeq(e->identity, digest, DIGEST_LEN)) {
+      entry = e;
+      idx = e_sl_idx;
+      break;
+    }
+  } SMARTLIST_FOREACH_END(e);
 
   if (!entry)
     return 0;