X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fiptables.c;h=20dce658b95e4edd1767a4b36e341e1308ea7759;hb=610204218564e01513607a0f077c33145f2b41f7;hp=1e35851ab7ff49f14e8208a7ee4d6fe5f11e87d0;hpb=09c12e0e1e0ef340a7074146684650ed54cba64d;p=collectd.git diff --git a/src/iptables.c b/src/iptables.c index 1e35851a..20dce658 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -111,7 +111,8 @@ static int iptables_config (const char *key, const char *value) else return (1); - ip_chain_t temp, *final, **list; + ip_chain_t temp = { 0 }; + ip_chain_t *final, **list; char *table; int table_len; char *chain; @@ -121,8 +122,6 @@ static int iptables_config (const char *key, const char *value) char *fields[4]; int fields_num; - memset (&temp, 0, sizeof (temp)); - value_copy = strdup (value); if (value_copy == NULL) { @@ -204,7 +203,7 @@ static int iptables_config (const char *key, const char *value) table = NULL; chain = NULL; - list = (ip_chain_t **) realloc (chain_list, (chain_num + 1) * sizeof (ip_chain_t *)); + list = realloc (chain_list, (chain_num + 1) * sizeof (ip_chain_t *)); if (list == NULL) { char errbuf[1024];