aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-04-30 01:09:03 +0000
committerNick Mathewson <nickm@torproject.org>2007-04-30 01:09:03 +0000
commite0b0c2a4d20f2992d6a2d1c80ff751c54a0897ce (patch)
tree20a236cb6c65319bdac378930429bef40ae31685
parent8dd603616eaeb00c258a34405d5b2043e27f4f82 (diff)
downloadtor-e0b0c2a4d20f2992d6a2d1c80ff751c54a0897ce.tar.gz
tor-e0b0c2a4d20f2992d6a2d1c80ff751c54a0897ce.zip
r12544@catbus: nickm | 2007-04-29 21:08:58 -0400
Fix an assertion when we call tor_free_all before calling do_main_loop(). Discovered by weasel. svn:r10046
-rw-r--r--src/or/relay.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 51e6702e61..a2058690d4 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1495,9 +1495,12 @@ init_cell_pool(void)
void
free_cell_pool(void)
{
- tor_assert(cell_pool);
- mp_pool_destroy(cell_pool);
- cell_pool = NULL;
+ /* Maybe we haven't called init_cell_pool yet; need to check for it. */
+ if (cell_pool) {
+ tor_assert(cell_pool);
+ mp_pool_destroy(cell_pool);
+ cell_pool = NULL;
+ }
}
/** Free excess storage in cell pool. */