summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-08-09 12:15:02 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2016-08-09 12:15:02 (GMT)
commit9176d3233fc395f579a33484ed714649e1fd8f46 (patch)
tree21480f77772070fe89fd4476e27931d2569affbb
parent6a2675557690a7eeab7b5c4ca70a80fd194e6466 (diff)
downloadnetsurf-9176d3233fc395f579a33484ed714649e1fd8f46.tar.gz
netsurf-9176d3233fc395f579a33484ed714649e1fd8f46.tar.bz2
ensure url database destructor cleans up correctly
-rw-r--r--content/urldb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/content/urldb.c b/content/urldb.c
index 12a3d41..8c2a3ae 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] = &empty;
+ }
}
/* 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;
+ }
}