@@ -1495,9 +1495,12 @@ init_cell_pool(void)
void
free_cell_pool(void)
{
- tor_assert(cell_pool);
+ /* Maybe we haven't called init_cell_pool yet; need to check for it. */
- mp_pool_destroy(cell_pool);
+ if (cell_pool) {
- cell_pool = NULL;
+ tor_assert(cell_pool);
+ mp_pool_destroy(cell_pool);
+ cell_pool = NULL;
+ }
}
/** Free excess storage in cell pool. */