summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremy Sowden <jeremy@azazel.net>2021-11-30 10:55:34 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2021-11-30 20:55:17 +0100
commit721aa6f74f17f56dd82873aefffb2d6683918b79 (patch)
tree136aa49ccd4120647dd0c752d7585475691ce12a /src
parentc3176a3b5c129cbb94f7ff3f18b03d81f847cef3 (diff)
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 <jeremy@azazel.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/ulogd.c3
1 files changed, 1 insertions, 2 deletions
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;