~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NEW etc.: Use NEW in all obvious places
[secnet]
/
util.c
diff --git
a/util.c
b/util.c
index
803098c
..
1d05822
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;
{
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);
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;
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;
st->cl.description="buffer";
st->cl.type=CL_BUFFER;
st->cl.apply=NULL;