|
@@ -1495,9 +1495,12 @@ init_cell_pool(void)
|
|
void
|
|
void
|
|
free_cell_pool(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. */
|
|
/** Free excess storage in cell pool. */
|