+/*
+ * This file is part of secnet.
+ * See README for full list of copyright holders.
+ *
+ * secnet is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * secnet is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 3 along with secnet; if not, see
+ * https://www.gnu.org/licenses/gpl.html.
+ */
#include "secnet.h"
#include <stdio.h>
#include <string.h>
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;
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;
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;
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;
{
struct fdlog *st;
- st=safe_malloc(sizeof(*st),"log_from_fd");
+ NEW(st);
st->log=log;
st->fd=fd;
st->prefix=prefix;