Commit c4438c80 by Juliusz Chroboczek

Simplify allocation in add_xroute.

1 parent cde24601
Showing 1 changed file with 1 additions and 3 deletions
......@@ -104,9 +104,7 @@ add_xroute(unsigned char prefix[16], unsigned char plen,
if(numxroutes >= maxxroutes) {
struct xroute *new_xroutes;
int n = maxxroutes < 1 ? 8 : 2 * maxxroutes;
new_xroutes = xroutes == NULL ?
malloc(n * sizeof(struct xroute)) :
realloc(xroutes, n * sizeof(struct xroute));
new_xroutes = realloc(xroutes, n * sizeof(struct xroute));
if(new_xroutes == NULL)
return -1;
maxxroutes = n;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!