[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r9138: fix an infinite loop and a memory leak in r9131 (tor/trunk/src/or)
Author: arma
Date: 2006-12-16 01:56:58 -0500 (Sat, 16 Dec 2006)
New Revision: 9138
Modified:
tor/trunk/src/or/router.c
Log:
fix an infinite loop and a memory leak in r9131
Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c 2006-12-15 22:40:20 UTC (rev 9137)
+++ tor/trunk/src/or/router.c 2006-12-16 06:56:58 UTC (rev 9138)
@@ -864,9 +864,11 @@
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 @@
}
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] = '$';