From: Ralph Dolmans Date: Mon, 10 Apr 2017 10:46:54 +0000 (+0000) Subject: - Zero initialize addrtree allocation. X-Git-Tag: release-1.6.2rc1~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7304e7c75ca6ebda32dc2e59f2f68e8ff2ebbf8;p=thirdparty%2Funbound.git - Zero initialize addrtree allocation. git-svn-id: file:///svn/unbound/trunk@4102 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index cbcb2cb6f..eb30d8d34 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,7 @@ - Remove ECS option after REFUSED answer. - Fix small memory leak in edns_opt_copy_alloc. - Respip dereference after NULL check. + - Zero initialize addrtree allocation. 7 April 2017: George - Fix pythonmod for cb changes. diff --git a/edns-subnet/addrtree.c b/edns-subnet/addrtree.c index 948c4f58a..69ace6054 100644 --- a/edns-subnet/addrtree.c +++ b/edns-subnet/addrtree.c @@ -124,7 +124,7 @@ addrtree_create(addrlen_t max_depth, void (*delfunc)(void *, void *), struct addrtree *tree; log_assert(delfunc != NULL); log_assert(sizefunc != NULL); - tree = (struct addrtree *)malloc( sizeof (*tree) ); + tree = (struct addrtree *)calloc(1, sizeof(*tree)); if (!tree) return NULL; tree->root = node_create(tree, NULL, 0, 0);