chiark / gitweb /
NEW etc.: Use NEW in all obvious places
[secnet.git] / util.c
diff --git a/util.c b/util.c
index 803098cb2b81183eae8161a963ff27d7c0c5c8d6..1d05822f5dfb53dcb80acefbd3d1575deb2d1138 100644 (file)
--- a/util.c
+++ b/util.c
@@ -240,7 +240,7 @@ bool_t add_hook(uint32_t phase, hook_fn *fn, void *state)
 {
     struct phase_hook *h;
 
-    h=safe_malloc(sizeof(*h),"add_hook");
+    NEW(h);
     h->fn=fn;
     h->state=state;
     LIST_INSERT_HEAD(&hooks[phase],h,entry);
@@ -398,7 +398,7 @@ static list_t *buffer_apply(closure_t *self, struct cloc loc, dict_t *context,
     bool_t lockdown=False;
     uint32_t len=DEFAULT_BUFFER_SIZE;
     
-    st=safe_malloc(sizeof(*st),"buffer_apply");
+    NEW(st);
     st->cl.description="buffer";
     st->cl.type=CL_BUFFER;
     st->cl.apply=NULL;