From 721aa6f74f17f56dd82873aefffb2d6683918b79 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Tue, 30 Nov 2021 10:55:34 +0000 Subject: Replace malloc+memset with calloc There are a number of places where we `malloc` some memory and then `memset` it to zero. Use `calloc` instead. Signed-off-by: Jeremy Sowden Signed-off-by: Pablo Neira Ayuso --- src/ulogd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/ulogd.c b/src/ulogd.c index 97da4fc..b02f260 100644 --- a/src/ulogd.c +++ b/src/ulogd.c @@ -661,12 +661,11 @@ pluginstance_alloc_init(struct ulogd_plugin *pl, char *pi_id, } size += pl->input.num_keys * sizeof(struct ulogd_key); size += pl->output.num_keys * sizeof(struct ulogd_key); - pi = malloc(size); + pi = calloc(1, size); if (!pi) return NULL; /* initialize */ - memset(pi, 0, size); INIT_LLIST_HEAD(&pi->list); INIT_LLIST_HEAD(&pi->plist); pi->plugin = pl; -- cgit v1.2.3