aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-10-16 08:39:56 +0000
committerNick Mathewson <nickm@torproject.org>2004-10-16 08:39:56 +0000
commit56a592dbe36701bbfdc262866d35ed34a265925e (patch)
tree1e924e2fce555d23e046cbc05ae25a1fa9cb0c8f
parent9d5831341e0818569a2964e25ee15eab143314e6 (diff)
downloadtor-56a592dbe36701bbfdc262866d35ed34a265925e.tar
tor-56a592dbe36701bbfdc262866d35ed34a265925e.tar.gz
Fix memory leak
svn:r2535
-rw-r--r--src/or/routerlist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 2205daf89..39e51687f 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -329,8 +329,10 @@ router_nickname_is_in_list(routerinfo_t *router, const char *list)
nickname_list = smartlist_create();
smartlist_split_string(nickname_list, list, ",",
SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
- SMARTLIST_FOREACH(nickname_list, char *, cp,
+ SMARTLIST_FOREACH(nickname_list, const char *, cp,
if (router_nickname_matches(router, cp)) {v=1;break;});
+ SMARTLIST_FOREACH(nickname_list, char *, cp, tor_free(cp));
+ smartlist_free(nickname_list);
return v;
}