Merge pull request #1830 from rubenk/move-collectd-header
[collectd.git] / src / iptables.c
index 1e35851..7ff59c1 100644 (file)
@@ -25,6 +25,7 @@
  **/
 
 #include "collectd.h"
+
 #include "common.h"
 #include "plugin.h"
 #include "configfile.h"
@@ -111,7 +112,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 +123,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 +204,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];