X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/8f828e0ffdab1adb6f28fd705c5830ef8f7ac2b4..b7886fd46ab05c97b8a072e497903622bd1d5290:/util.c diff --git a/util.c b/util.c index 803098c..1d05822 100644 --- 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;