X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=blobdiff_plain;f=log.c;h=a2e24aed61e1fd37669648f46519cc6f3ce896b7;hp=d8b5151132755d417ccb44cccc04a548732a8939;hb=423936d35d7671fd017d2d611d418d1b8eeb6195;hpb=b85fe3f90b025a3742bf1c0ea91bc213a421f74d diff --git a/log.c b/log.c index d8b5151..a2e24ae 100644 --- a/log.c +++ b/log.c @@ -266,7 +266,7 @@ struct log_if *init_log(list_t *ll) if (cl->type!=CL_LOG) { cfgfatal(item->loc,"init_log","closure is not a logger"); } - n=safe_malloc(sizeof(*n),"init_log"); + NEW(n); n->l=cl->interface; n->next=l; l=n; @@ -274,7 +274,7 @@ struct log_if *init_log(list_t *ll) if (!l) { fatal("init_log: no log"); } - r=safe_malloc(sizeof(*r), "init_log"); + NEW(r); r->st=l; r->vlogfn=log_vmulti; r->buff[0]=0; @@ -402,7 +402,7 @@ static list_t *logfile_apply(closure_t *self, struct cloc loc, dict_t *context, phase. We should defer writing into the logfile until after we become a daemon. */ - st=safe_malloc(sizeof(*st),"logfile_apply"); + NEW(st); st->cl.description="logfile"; st->cl.type=CL_LOG; st->cl.apply=NULL; @@ -517,7 +517,7 @@ static list_t *syslog_apply(closure_t *self, struct cloc loc, dict_t *context, item_t *item; string_t facstr; - st=safe_malloc(sizeof(*st),"syslog_apply"); + NEW(st); st->cl.description="syslog"; st->cl.type=CL_LOG; st->cl.apply=NULL; @@ -613,7 +613,7 @@ void log_from_fd(int fd, cstring_t prefix, struct log_if *log) { struct fdlog *st; - st=safe_malloc(sizeof(*st),"log_from_fd"); + NEW(st); st->log=log; st->fd=fd; st->prefix=prefix;