]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Filter: Prefer xmalloc/xfree to malloc/free
authorPavel Tvrdik <pawel.tvrdik@gmail.com>
Tue, 6 Sep 2016 15:18:15 +0000 (17:18 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Thu, 15 Sep 2016 13:24:00 +0000 (15:24 +0200)
filter/tree.c

index 59ebf579b857889a4312d414389775d7759c725e..328c7184b51a0a22e783c7ff0afc27f29754a529 100644 (file)
@@ -82,7 +82,7 @@ build_tree(struct f_tree *from)
   if (len <= 1024)
     buf = alloca(len * sizeof(struct f_tree *));
   else
-    buf = malloc(len * sizeof(struct f_tree *));
+    buf = xmalloc(len * sizeof(struct f_tree *));
 
   /* Convert a degenerated tree into an sorted array */
   i = 0;
@@ -94,7 +94,7 @@ build_tree(struct f_tree *from)
   root = build_tree_rec(buf, 0, len);
 
   if (len > 1024)
-    free(buf);
+    xfree(buf);
 
   return root;
 }