]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Zero initialize addrtree allocation.
authorRalph Dolmans <ralph@nlnetlabs.nl>
Mon, 10 Apr 2017 10:46:54 +0000 (10:46 +0000)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Mon, 10 Apr 2017 10:46:54 +0000 (10:46 +0000)
git-svn-id: file:///svn/unbound/trunk@4102 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
edns-subnet/addrtree.c

index cbcb2cb6f376ae5eb5b4cebb20b28f5e6b791355..eb30d8d34aeea9fe02d0022a679d88627b2d18b7 100644 (file)
@@ -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.
index 948c4f58a6da42b2596f0b0fb7b72a61f72d09a6..69ace60549bf135cc97ae10f63dbb70781d87227 100644 (file)
@@ -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);