From 9176d3233fc395f579a33484ed714649e1fd8f46 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 9 Aug 2016 13:15:02 +0100 Subject: ensure url database destructor cleans up correctly --- content/urldb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'content') diff --git a/content/urldb.c b/content/urldb.c index 12a3d4182..8c2a3ae04 100644 --- a/content/urldb.c +++ b/content/urldb.c @@ -2480,8 +2480,10 @@ void urldb_destroy(void) /* Clean up search trees */ for (i = 0; i < NUM_SEARCH_TREES; i++) { - if (search_trees[i] != &empty) + if (search_trees[i] != &empty) { urldb_destroy_search_tree(search_trees[i]); + search_trees[i] = ∅ + } } /* And database */ @@ -2489,10 +2491,13 @@ void urldb_destroy(void) b = a->next; urldb_destroy_host_tree(a); } + memset(&db_root, 0, sizeof(db_root)); /* And the bloom filter */ - if (url_bloom != NULL) + if (url_bloom != NULL) { bloom_destroy(url_bloom); + url_bloom = NULL; + } } -- cgit v1.2.3