From 577a1f4a41082cc121ee9007e99eabe41550b24d Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Fri, 17 Mar 2017 00:57:23 +0200 Subject: [PATCH] properly initialize the just allocated global structures --- src/plugin_nfacct.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugin_nfacct.c b/src/plugin_nfacct.c index db86b678..a67480a3 100644 --- a/src/plugin_nfacct.c +++ b/src/plugin_nfacct.c @@ -32,10 +32,7 @@ static inline void nfacct_list_grow() { info("nfacct.plugin: increasing nfacct_list to size %d", size); nfacct_list = reallocz(nfacct_list, sizeof(struct nfacct_list) + (sizeof(struct mynfacct) * size)); - - nfacct_list->data[len].rd_bytes = NULL; - nfacct_list->data[len].rd_packets = NULL; - nfacct_list->data[len].updated = 0; + memset(&nfacct_list->data[len], 0, sizeof(struct mynfacct)); nfacct_list->size = size; nfacct_list->len = len; -- 2.39.2