summaryrefslogtreecommitdiff
path: root/src/or/rendcommon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/rendcommon.c')
-rw-r--r--src/or/rendcommon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 44cbc1b534..49a21f63ae 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -837,8 +837,10 @@ _rend_cache_entry_free(void *p)
void
rend_cache_free_all(void)
{
- strmap_free(rend_cache, _rend_cache_entry_free);
- digestmap_free(rend_cache_v2_dir, _rend_cache_entry_free);
+ if (rend_cache)
+ strmap_free(rend_cache, _rend_cache_entry_free);
+ if (rend_cache_v2_dir)
+ digestmap_free(rend_cache_v2_dir, _rend_cache_entry_free);
rend_cache = NULL;
rend_cache_v2_dir = NULL;
}