]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Check for out of memory.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 1 May 2015 13:35:02 +0000 (13:35 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 1 May 2015 13:35:02 +0000 (13:35 +0000)
git-svn-id: file:///svn/unbound/trunk@3421 be551aaa-1e26-0410-a405-d3ace91eadb9

iterator/iter_utils.c

index 3df952841c68146e0bd667ee8d63abc7483b5e77..bc94ef682247ccaa0664cfa1a649f514930eb810 100644 (file)
@@ -120,6 +120,11 @@ caps_white_apply_cfg(rbtree_t* ntree, struct config_file* cfg)
                        return 0;
                }
                n = (struct name_tree_node*)calloc(1, sizeof(*n));
+               if(!n) {
+                       log_err("out of memory");
+                       free(nm);
+                       return 0;
+               }
                n->node.key = n;
                n->name = nm;
                n->len = len;