]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r12544@catbus: nickm | 2007-04-29 21:08:58 -0400
authorNick Mathewson <nickm@torproject.org>
Mon, 30 Apr 2007 01:09:03 +0000 (01:09 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 30 Apr 2007 01:09:03 +0000 (01:09 +0000)
 Fix an assertion when we call tor_free_all before calling do_main_loop(). Discovered by weasel.

svn:r10046

src/or/relay.c

index 51e6702e61e22b6407d4bb9086b0364547057d2f..a2058690d4967b0fb15a4f92eebbc7597af1ced6 100644 (file)
@@ -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. */