199 |
|
if (family == AF_INET6) { |
200 |
|
default_bitlen = sizeof(struct in6_addr) * 8; |
201 |
|
if (prefix == NULL) { |
202 |
< |
prefix = MyCalloc(sizeof (prefix_t)); |
202 |
> |
prefix = xcalloc(sizeof (prefix_t)); |
203 |
|
dynamic_allocated++; |
204 |
|
} |
205 |
|
memcpy (&prefix->add.sin6, dest, sizeof(struct in6_addr)); |
206 |
|
} |
207 |
|
else if (family == AF_INET) { |
208 |
|
if (prefix == NULL) { |
209 |
< |
prefix = MyCalloc(sizeof (prefix4_t)); |
209 |
> |
prefix = xcalloc(sizeof (prefix4_t)); |
210 |
|
dynamic_allocated++; |
211 |
|
} |
212 |
|
memcpy (&prefix->add.sin, dest, sizeof(struct in_addr)); |
331 |
|
patricia_tree_t * |
332 |
|
New_Patricia (int maxbits) |
333 |
|
{ |
334 |
< |
patricia_tree_t *patricia = MyCalloc(sizeof *patricia); |
334 |
> |
patricia_tree_t *patricia = xcalloc(sizeof *patricia); |
335 |
|
|
336 |
|
patricia->maxbits = maxbits; |
337 |
|
patricia->head = NULL; |
369 |
|
else { |
370 |
|
assert (Xrn->data == NULL); |
371 |
|
} |
372 |
< |
MyFree (Xrn); |
372 |
> |
xfree (Xrn); |
373 |
|
patricia->num_active_node--; |
374 |
|
|
375 |
|
if (l) { |
387 |
|
} |
388 |
|
} |
389 |
|
assert (patricia->num_active_node == 0); |
390 |
< |
/* MyFree (patricia); */ |
390 |
> |
/* xfree (patricia); */ |
391 |
|
} |
392 |
|
|
393 |
|
|
395 |
|
Destroy_Patricia (patricia_tree_t *patricia, void_fn_t func) |
396 |
|
{ |
397 |
|
Clear_Patricia (patricia, func); |
398 |
< |
MyFree (patricia); |
398 |
> |
xfree (patricia); |
399 |
|
num_active_patricia--; |
400 |
|
} |
401 |
|
|
599 |
|
assert (prefix->bitlen <= patricia->maxbits); |
600 |
|
|
601 |
|
if (patricia->head == NULL) { |
602 |
< |
node = MyCalloc(sizeof *node); |
602 |
> |
node = xcalloc(sizeof *node); |
603 |
|
node->bit = prefix->bitlen; |
604 |
|
node->prefix = Ref_Prefix (prefix); |
605 |
|
node->parent = NULL; |
710 |
|
return (node); |
711 |
|
} |
712 |
|
|
713 |
< |
new_node = MyCalloc(sizeof *new_node); |
713 |
> |
new_node = xcalloc(sizeof *new_node); |
714 |
|
new_node->bit = prefix->bitlen; |
715 |
|
new_node->prefix = Ref_Prefix (prefix); |
716 |
|
new_node->parent = NULL; |
762 |
|
#endif /* PATRICIA_DEBUG */ |
763 |
|
} |
764 |
|
else { |
765 |
< |
glue = MyCalloc(sizeof *glue); |
765 |
> |
glue = xcalloc(sizeof *glue); |
766 |
|
glue->bit = differ_bit; |
767 |
|
glue->prefix = NULL; |
768 |
|
glue->parent = node->parent; |
830 |
|
#endif /* PATRICIA_DEBUG */ |
831 |
|
parent = node->parent; |
832 |
|
Deref_Prefix (node->prefix); |
833 |
< |
MyFree (node); |
833 |
> |
xfree (node); |
834 |
|
patricia->num_active_node--; |
835 |
|
|
836 |
|
if (parent == NULL) { |
866 |
|
parent->parent->l = child; |
867 |
|
} |
868 |
|
child->parent = parent->parent; |
869 |
< |
MyFree (parent); |
869 |
> |
xfree (parent); |
870 |
|
patricia->num_active_node--; |
871 |
|
return; |
872 |
|
} |