diff options
author | Roger Dingledine <arma@torproject.org> | 2006-12-16 06:56:58 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-12-16 06:56:58 +0000 |
commit | 9cd8feb64913cc0c5d4c0be35dc77eaf93dc8921 (patch) | |
tree | 2e60aedd5caf9ccbf5cf468ea6855b1517c7fbdb /src/or/router.c | |
parent | 31e09bb5242b24d50fcc306fc3b423e0468e1726 (diff) | |
download | tor-9cd8feb64913cc0c5d4c0be35dc77eaf93dc8921.tar.gz tor-9cd8feb64913cc0c5d4c0be35dc77eaf93dc8921.zip |
fix an infinite loop and a memory leak in r9131
svn:r9138
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/or/router.c b/src/or/router.c index 940f462c5a..fbf2469fcc 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -864,9 +864,11 @@ router_rebuild_descriptor(int force) SMARTLIST_FOREACH(family, char *, name, { routerinfo_t *member; - if (!strcasecmp(name, options->Nickname)) - member = ri; - else + if (!strcasecmp(name, options->Nickname)) { + /* Don't list ourself in our own family; that's redundant */ + tor_free(name); + continue; + } else member = router_get_by_nickname(name, 1); if (!member) { if (!smartlist_string_isin(warned_nonexistent_family, name) && @@ -879,9 +881,6 @@ router_rebuild_descriptor(int force) } smartlist_add(ri->declared_family, name); name = NULL; - } else if (router_is_me(member)) { - /* Don't list ourself in our own family; that's redundant */ - continue; } else { char *fp = tor_malloc(HEX_DIGEST_LEN+2); fp[0] = '$'; |