X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fiptables.c;h=c1f42d73aec4d842ea548f64472a7cc7144e73d9;hb=a396da422740caf336a6d594515e8d80de6f440a;hp=286c6e9b6ca4318fa6a1b059e3f1337643434e19;hpb=4eca75de34e9c3d7f2391b9c7a5951a27a713804;p=collectd.git diff --git a/src/iptables.c b/src/iptables.c index 286c6e9b..c1f42d73 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -86,7 +86,7 @@ typedef struct { char name[64]; } ip_chain_t; -static ip_chain_t **chain_list = NULL; +static ip_chain_t **chain_list; static int chain_num = 0; static int iptables_config(const char *key, const char *value) { @@ -113,8 +113,7 @@ static int iptables_config(const char *key, const char *value) { value_copy = strdup(value); if (value_copy == NULL) { - char errbuf[1024]; - ERROR("strdup failed: %s", sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("strdup failed: %s", STRERRNO); return 1; } @@ -182,8 +181,7 @@ static int iptables_config(const char *key, const char *value) { list = realloc(chain_list, (chain_num + 1) * sizeof(ip_chain_t *)); if (list == NULL) { - char errbuf[1024]; - ERROR("realloc failed: %s", sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("realloc failed: %s", STRERRNO); sfree(temp.rule.comment); return 1; } @@ -191,8 +189,7 @@ static int iptables_config(const char *key, const char *value) { chain_list = list; final = malloc(sizeof(*final)); if (final == NULL) { - char errbuf[1024]; - ERROR("malloc failed: %s", sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("malloc failed: %s", STRERRNO); sfree(temp.rule.comment); return 1; }