mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Filter: Prefer xmalloc/xfree to malloc/free
This commit is contained in:
parent
4adcb9df1b
commit
bc00f05815
@ -82,7 +82,7 @@ build_tree(struct f_tree *from)
|
|||||||
if (len <= 1024)
|
if (len <= 1024)
|
||||||
buf = alloca(len * sizeof(struct f_tree *));
|
buf = alloca(len * sizeof(struct f_tree *));
|
||||||
else
|
else
|
||||||
buf = malloc(len * sizeof(struct f_tree *));
|
buf = xmalloc(len * sizeof(struct f_tree *));
|
||||||
|
|
||||||
/* Convert a degenerated tree into an sorted array */
|
/* Convert a degenerated tree into an sorted array */
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -94,7 +94,7 @@ build_tree(struct f_tree *from)
|
|||||||
root = build_tree_rec(buf, 0, len);
|
root = build_tree_rec(buf, 0, len);
|
||||||
|
|
||||||
if (len > 1024)
|
if (len > 1024)
|
||||||
free(buf);
|
xfree(buf);
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user