Replace all calls to safe_malloc_ary with the NEW_ARY wrapper.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
}
int32_t ll=list_length(l);
}
int32_t ll=list_length(l);
- ra=safe_malloc_ary(sizeof(*ra), ll+1, "dict_read_string_array");
for (rap=ra; l; l=l->next,rap++) {
item_t *it=l->item;
if (it->type!=t_string)
for (rap=ra; l; l=l->next,rap++) {
item_t *it=l->item;
if (it->type!=t_string)
NEW(r);
r->entries=0;
r->alloc=DEFAULT_ALLOC;
NEW(r);
r->entries=0;
r->alloc=DEFAULT_ALLOC;
- r->list=safe_malloc_ary(sizeof(*r->list),r->alloc,"subnet_list_new:data");
+ NEW_ARY(r->list,r->alloc);
/* All the networks serviced by the various tunnels should now
* have been registered. We build a routing table by sorting the
* clients by priority. */
/* All the networks serviced by the various tunnels should now
* have been registered. We build a routing table by sorting the
* clients by priority. */
- st->routes=safe_malloc_ary(sizeof(*st->routes),st->n_clients,
- "netlink_phase_hook");
+ NEW_ARY(st->routes,st->n_clients);
/* Fill the table */
i=0;
for (c=st->clients; c; c=c->next) {
/* Fill the table */
i=0;
for (c=st->clients; c; c=c->next) {
if (!things##_cfg) \
cfgfatal(loc,"site","closure list \"%s\" not found\n",dictkey); \
st->nthings=list_length(things##_cfg); \
if (!things##_cfg) \
cfgfatal(loc,"site","closure list \"%s\" not found\n",dictkey); \
st->nthings=list_length(things##_cfg); \
- st->things=safe_malloc_ary(sizeof(*st->things),st->nthings,dictkey "s"); \
+ NEW_ARY(st->things,st->nthings); \
assert(st->nthings); \
for (i=0; i<st->nthings; i++) { \
item_t *item=list_elem(things##_cfg,i); \
assert(st->nthings); \
for (i=0; i<st->nthings; i++) { \
item_t *item=list_elem(things##_cfg,i); \