diff options
author | Roger Dingledine <arma@torproject.org> | 2007-11-15 11:14:08 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-11-15 11:14:08 +0000 |
commit | 06a1e4124f1ef048bd10a5d296b9380b995f0de8 (patch) | |
tree | 483378d7b7bb84ca7fd2f0153e0bd0b280992ce0 /src/or | |
parent | 6c6d27186ae76e4166a826e2d939f944aeedaa7d (diff) | |
download | tor-06a1e4124f1ef048bd10a5d296b9380b995f0de8.tar tor-06a1e4124f1ef048bd10a5d296b9380b995f0de8.tar.gz |
Fix a small memory leak whenever we decide against using a
newly picked entry guard. Reported by Mike Perry.
svn:r12506
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/circuitbuild.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 761bcfe6a..3a86b95b6 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2281,7 +2281,7 @@ entry_guard_register_connect_status(const char *digest, int succeeded, "Removing from the list. %d/%d entry guards usable/new.", entry->nickname, buf, num_live_entry_guards()-1, smartlist_len(entry_guards)-1); - tor_free(entry); + entry_guard_free(entry); smartlist_del_keeporder(entry_guards, idx); log_entry_guards(LOG_INFO); changed = 1; @@ -2291,6 +2291,7 @@ entry_guard_register_connect_status(const char *digest, int succeeded, entry->unreachable_since = entry->last_attempted = now; control_event_guard(entry->nickname, entry->identity, "DOWN"); changed = 1; + entry->can_retry = 0; /* We gave it an early chance; no good. */ } else { char tbuf[ISO_TIME_LEN+1]; format_iso_time(tbuf, entry->unreachable_since); @@ -2298,9 +2299,8 @@ entry_guard_register_connect_status(const char *digest, int succeeded, "'%s' (%s). It has been unreachable since %s.", entry->nickname, buf, tbuf); entry->last_attempted = now; - } - if (entry) entry->can_retry = 0; /* We gave it an early chance; no good. */ + } } if (first_contact) { |