- Zero initialize addrtree allocation.

git-svn-id: file:///svn/unbound/trunk@4102 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Ralph Dolmans 2017-04-10 10:46:54 +00:00
parent bde9269510
commit d7304e7c75
2 changed files with 2 additions and 1 deletions

View file

@ -2,6 +2,7 @@
- Remove ECS option after REFUSED answer. - Remove ECS option after REFUSED answer.
- Fix small memory leak in edns_opt_copy_alloc. - Fix small memory leak in edns_opt_copy_alloc.
- Respip dereference after NULL check. - Respip dereference after NULL check.
- Zero initialize addrtree allocation.
7 April 2017: George 7 April 2017: George
- Fix pythonmod for cb changes. - Fix pythonmod for cb changes.

View file

@ -124,7 +124,7 @@ addrtree_create(addrlen_t max_depth, void (*delfunc)(void *, void *),
struct addrtree *tree; struct addrtree *tree;
log_assert(delfunc != NULL); log_assert(delfunc != NULL);
log_assert(sizefunc != NULL); log_assert(sizefunc != NULL);
tree = (struct addrtree *)malloc( sizeof (*tree) ); tree = (struct addrtree *)calloc(1, sizeof(*tree));
if (!tree) if (!tree)
return NULL; return NULL;
tree->root = node_create(tree, NULL, 0, 0); tree->root = node_create(tree, NULL, 0, 0);