chiark / gitweb /
udp: Insist on only one successful default socket setup
[secnet.git] / netlink.c
index 601686425124cb7d7bb46cb03500f9df75e7c909..75763cf520719fc1bfc2934da725344121c35aa0 100644 (file)
--- a/netlink.c
+++ b/netlink.c
@@ -1039,8 +1039,7 @@ static void netlink_phase_hook(void *sst, uint32_t new_phase)
     /* 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) {
@@ -1138,7 +1137,7 @@ static closure_t *netlink_inst_create(struct netlink *st,
        return NULL;
     }
 
-    c=safe_malloc(sizeof(*c),"netlink_inst_create");
+    NEW(c);
     c->cl.description=name;
     c->cl.type=CL_NETLINK;
     c->cl.apply=NULL;
@@ -1307,7 +1306,7 @@ static list_t *null_apply(closure_t *self, struct cloc loc, dict_t *context,
     item_t *item;
     dict_t *dict;
 
-    st=safe_malloc(sizeof(*st),"null_apply");
+    NEW(st);
 
     item=list_elem(args,0);
     if (!item || item->type!=t_dict)