projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
grpc plugin: Rename "Reply" messages to "Response".
[collectd.git]
/
src
/
iptables.c
diff --git
a/src/iptables.c
b/src/iptables.c
index
05e3e24
..
20dce65
100644
(file)
--- 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);
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;
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;
char *fields[4];
int fields_num;
- memset (&temp, 0, sizeof (temp));
-
value_copy = strdup (value);
if (value_copy == NULL)
{
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;
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];
if (list == NULL)
{
char errbuf[1024];
@@
-215,7
+214,7
@@
static int iptables_config (const char *key, const char *value)
}
chain_list = list;
}
chain_list = list;
- final =
(ip_chain_t *) malloc( sizeof(temp)
);
+ final =
malloc(sizeof (*final)
);
if (final == NULL)
{
char errbuf[1024];
if (final == NULL)
{
char errbuf[1024];