aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-02-24 23:01:26 +0000
committerRoger Dingledine <arma@torproject.org>2005-02-24 23:01:26 +0000
commit6329811a8804ff6755727a32e7da4b8ea17593fd (patch)
tree79f7ad8bc354be9a46782dc3393f0efd297fa055 /src/or
parent59b1b7770c71be5973e7a697dc4c33df0d8b39c7 (diff)
downloadtor-6329811a8804ff6755727a32e7da4b8ea17593fd.tar.gz
tor-6329811a8804ff6755727a32e7da4b8ea17593fd.zip
fix a seg fault from tor_free_all
svn:r3690
Diffstat (limited to 'src/or')
-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 db9f08b6d3..d2de86eb0f 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -709,6 +709,7 @@ routerinfo_t *routerinfo_copy(const routerinfo_t *router)
/** Free all storage held by a routerlist <b>rl</b> */
void routerlist_free(routerlist_t *rl)
{
+ tor_assert(rl);
SMARTLIST_FOREACH(rl->routers, routerinfo_t *, r,
routerinfo_free(r));
smartlist_free(rl->routers);
@@ -718,7 +719,8 @@ void routerlist_free(routerlist_t *rl)
void routerlist_free_current(void)
{
- routerlist_free(routerlist);
+ if (routerlist)
+ routerlist_free(routerlist);
routerlist = NULL;
}