소스 검색

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

Nick Mathewson 18 년 전
부모
커밋
e0b0c2a4d2
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      src/or/relay.c

+ 6 - 3
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. */