2014-12-29 15:38:14 +01:00
|
|
|
From 85dfe7dcd20c54e6d75d66a400f7ae038a52239b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
Date: Mon, 29 Dec 2014 15:31:40 +0100
|
|
|
|
Subject: [PATCH 1/2] Rename xfree() to libnftnl_xfree() to avoid symbol naming
|
|
|
|
conflict
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
When ELF binaries and shared libraries are used, the internal
|
|
|
|
functions of libnftnl such as xfree() are not visible to the outside
|
|
|
|
world (their visibility is 'hidden'). Therefore, the fact that other
|
|
|
|
programs (especially nftables) may have symbols with the same name
|
|
|
|
does not cause any problem.
|
|
|
|
|
|
|
|
However, when doing static linking on a non-ELF platform (such as
|
|
|
|
Blackfin, which uses the FLAT binary format), there is no way of
|
|
|
|
encoding this visibility. Therefore, the xfree() symbols of libnftnl
|
|
|
|
becomes visible to the outside world, causing a conflict with the
|
|
|
|
xfree() symbol defined by nftables.
|
|
|
|
|
|
|
|
To solve this, this patch renames the libnftnl xfree() function to
|
|
|
|
libnftnl_xfree().
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
2015-10-02 16:20:59 +02:00
|
|
|
[Gustavo: update for version 1.0.5]
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2014-12-29 15:38:14 +01:00
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
---
|
2015-10-02 16:20:59 +02:00
|
|
|
include/utils.h | 2 +-
|
|
|
|
src/chain.c | 28 ++++++++++++++--------------
|
2014-12-29 15:38:14 +01:00
|
|
|
src/common.c | 2 +-
|
2015-10-02 16:20:59 +02:00
|
|
|
src/expr.c | 4 ++--
|
|
|
|
src/expr/data_reg.c | 4 ++--
|
2014-12-29 15:38:14 +01:00
|
|
|
src/expr/immediate.c | 2 +-
|
|
|
|
src/expr/log.c | 6 +++---
|
|
|
|
src/expr/match.c | 6 +++---
|
|
|
|
src/expr/target.c | 6 +++---
|
|
|
|
src/gen.c | 2 +-
|
|
|
|
src/mxml.c | 2 +-
|
2015-10-02 16:20:59 +02:00
|
|
|
src/rule.c | 26 +++++++++++++-------------
|
2014-12-29 15:38:14 +01:00
|
|
|
src/ruleset.c | 2 +-
|
2015-10-02 16:20:59 +02:00
|
|
|
src/set.c | 22 +++++++++++-----------
|
|
|
|
src/set_elem.c | 16 ++++++++--------
|
|
|
|
src/table.c | 14 +++++++-------
|
2014-12-29 15:38:14 +01:00
|
|
|
src/utils.c | 2 +-
|
2015-10-02 16:20:59 +02:00
|
|
|
17 files changed, 73 insertions(+), 73 deletions(-)
|
2014-12-29 15:38:14 +01:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
diff --git a/include/utils.h b/include/utils.h
|
|
|
|
index f7436fa..e03ee3b 100644
|
|
|
|
--- a/include/utils.h
|
|
|
|
+++ b/include/utils.h
|
|
|
|
@@ -17,7 +17,7 @@
|
|
|
|
|
|
|
|
#define __noreturn __attribute__((__noreturn__))
|
|
|
|
|
|
|
|
-#define xfree(ptr) free((void *)ptr);
|
|
|
|
+#define nftnl_xfree(ptr) free((void *)ptr);
|
|
|
|
|
|
|
|
#define div_round_up(n, d) (((n) + (d) - 1) / (d))
|
|
|
|
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/chain.c b/src/chain.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index 8a8e8b8..37a27b1 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/chain.c
|
|
|
|
+++ b/src/chain.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -96,13 +96,13 @@ EXPORT_SYMBOL(nftnl_chain_alloc, nft_chain_alloc);
|
|
|
|
void nftnl_chain_free(struct nftnl_chain *c)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
|
|
|
if (c->table != NULL)
|
|
|
|
- xfree(c->table);
|
|
|
|
+ nftnl_xfree(c->table);
|
|
|
|
if (c->type != NULL)
|
|
|
|
- xfree(c->type);
|
|
|
|
+ nftnl_xfree(c->type);
|
2015-10-02 16:20:59 +02:00
|
|
|
if (c->dev != NULL)
|
|
|
|
- xfree(c->dev);
|
|
|
|
+ nftnl_xfree(c->dev);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
- xfree(c);
|
|
|
|
+ nftnl_xfree(c);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_chain_free, nft_chain_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -120,7 +120,7 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
|
2014-08-16 15:35:48 +02:00
|
|
|
switch (attr) {
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_CHAIN_TABLE:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (c->table) {
|
|
|
|
- xfree(c->table);
|
|
|
|
+ nftnl_xfree(c->table);
|
|
|
|
c->table = NULL;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -128,7 +128,7 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
|
2014-12-16 12:42:57 +01:00
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_CHAIN_TYPE:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (c->type) {
|
|
|
|
- xfree(c->type);
|
|
|
|
+ nftnl_xfree(c->type);
|
|
|
|
c->type = NULL;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -143,7 +143,7 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
|
|
|
|
break;
|
|
|
|
case NFTNL_CHAIN_DEV:
|
|
|
|
if (c->dev) {
|
|
|
|
- xfree(c->dev);
|
|
|
|
+ nftnl_xfree(c->dev);
|
|
|
|
c->dev = NULL;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
@@ -179,7 +179,7 @@ void nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
|
2014-08-16 15:35:48 +02:00
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_CHAIN_TABLE:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (c->table)
|
|
|
|
- xfree(c->table);
|
|
|
|
+ nftnl_xfree(c->table);
|
|
|
|
|
|
|
|
c->table = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -209,13 +209,13 @@ void nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
|
2014-08-16 15:35:48 +02:00
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_CHAIN_TYPE:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (c->type)
|
|
|
|
- xfree(c->type);
|
|
|
|
+ nftnl_xfree(c->type);
|
|
|
|
|
|
|
|
c->type = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_CHAIN_DEV:
|
|
|
|
if (c->dev)
|
|
|
|
- xfree(c->dev);
|
|
|
|
+ nftnl_xfree(c->dev);
|
|
|
|
|
|
|
|
c->dev = strdup(data);
|
|
|
|
break;
|
|
|
|
@@ -535,7 +535,7 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
|
|
|
|
c->flags |= (1 << NFTNL_CHAIN_NAME);
|
|
|
|
}
|
|
|
|
if (tb[NFTA_CHAIN_TABLE]) {
|
|
|
|
- xfree(c->table);
|
|
|
|
+ nftnl_xfree(c->table);
|
|
|
|
c->table = strdup(mnl_attr_get_str(tb[NFTA_CHAIN_TABLE]));
|
|
|
|
c->flags |= (1 << NFTNL_CHAIN_TABLE);
|
|
|
|
}
|
|
|
|
@@ -562,7 +562,7 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
|
|
|
|
c->flags |= (1 << NFTNL_CHAIN_HANDLE);
|
|
|
|
}
|
|
|
|
if (tb[NFTA_CHAIN_TYPE]) {
|
|
|
|
- xfree(c->type);
|
|
|
|
+ nftnl_xfree(c->type);
|
|
|
|
c->type = strdup(mnl_attr_get_str(tb[NFTA_CHAIN_TYPE]));
|
|
|
|
c->flags |= (1 << NFTNL_CHAIN_TYPE);
|
|
|
|
}
|
|
|
|
@@ -976,7 +976,7 @@ void nftnl_chain_list_free(struct nftnl_chain_list *list)
|
2014-08-16 15:35:48 +02:00
|
|
|
list_del(&r->head);
|
2015-10-02 16:20:59 +02:00
|
|
|
nftnl_chain_free(r);
|
2014-08-16 15:35:48 +02:00
|
|
|
}
|
|
|
|
- xfree(list);
|
|
|
|
+ nftnl_xfree(list);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_chain_list_free, nft_chain_list_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -1061,6 +1061,6 @@ EXPORT_SYMBOL(nftnl_chain_list_iter_next, nft_chain_list_iter_next);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
void nftnl_chain_list_iter_destroy(struct nftnl_chain_list_iter *iter)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
|
|
|
- xfree(iter);
|
|
|
|
+ nftnl_xfree(iter);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_chain_list_iter_destroy, nft_chain_list_iter_destroy);
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/common.c b/src/common.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index 43d2cfd..0bc814d 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/common.c
|
|
|
|
+++ b/src/common.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -58,7 +58,7 @@ EXPORT_SYMBOL(nftnl_parse_err_alloc, nft_parse_err_alloc);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
void nftnl_parse_err_free(struct nftnl_parse_err *err)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
|
|
|
- xfree(err);
|
|
|
|
+ nftnl_xfree(err);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_parse_err_free, nft_parse_err_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/expr.c b/src/expr.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index 3249a5c..8563d9e 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/expr.c
|
|
|
|
+++ b/src/expr.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -50,7 +50,7 @@ void nftnl_expr_free(struct nftnl_expr *expr)
|
2014-12-29 15:38:14 +01:00
|
|
|
if (expr->ops->free)
|
|
|
|
expr->ops->free(expr);
|
|
|
|
|
|
|
|
- xfree(expr);
|
|
|
|
+ nftnl_xfree(expr);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_expr_free, nft_rule_expr_free);
|
|
|
|
|
|
|
|
@@ -257,7 +257,7 @@ struct nftnl_expr *nftnl_expr_parse(struct nlattr *attr)
|
|
|
|
return expr;
|
2014-12-29 15:38:14 +01:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
err2:
|
|
|
|
- xfree(expr);
|
|
|
|
+ nftnl_xfree(expr);
|
|
|
|
err1:
|
|
|
|
return NULL;
|
|
|
|
}
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/expr/data_reg.c b/src/expr/data_reg.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index b85d2ef..32becb4 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/expr/data_reg.c
|
|
|
|
+++ b/src/expr/data_reg.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -123,7 +123,7 @@ static int nftnl_data_reg_verdict_xml_parse(union nftnl_data_reg *reg,
|
|
|
|
NFTNL_XML_OPT, err);
|
2014-08-16 15:35:48 +02:00
|
|
|
if (chain != NULL) {
|
|
|
|
if (reg->chain)
|
|
|
|
- xfree(reg->chain);
|
|
|
|
+ nftnl_xfree(reg->chain);
|
|
|
|
|
|
|
|
reg->chain = strdup(chain);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -504,7 +504,7 @@ void nftnl_free_verdict(union nftnl_data_reg *data)
|
|
|
|
switch(data->verdict) {
|
|
|
|
case NFT_JUMP:
|
|
|
|
case NFT_GOTO:
|
|
|
|
- xfree(data->chain);
|
|
|
|
+ nftnl_xfree(data->chain);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/expr/immediate.c b/src/expr/immediate.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index c2fb9ad..4a8cd83 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/expr/immediate.c
|
|
|
|
+++ b/src/expr/immediate.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -44,7 +44,7 @@ nftnl_expr_immediate_set(struct nftnl_expr *e, uint16_t type,
|
2014-08-16 15:35:48 +02:00
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_EXPR_IMM_CHAIN:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (imm->data.chain)
|
|
|
|
- xfree(imm->data.chain);
|
|
|
|
+ nftnl_xfree(imm->data.chain);
|
|
|
|
|
|
|
|
imm->data.chain = strdup(data);
|
|
|
|
break;
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/expr/log.c b/src/expr/log.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index f615d8e..1957aa6 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/expr/log.c
|
|
|
|
+++ b/src/expr/log.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -38,7 +38,7 @@ static int nftnl_expr_log_set(struct nftnl_expr *e, uint16_t type,
|
2014-08-16 15:35:48 +02:00
|
|
|
switch(type) {
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_EXPR_LOG_PREFIX:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (log->prefix)
|
|
|
|
- xfree(log->prefix);
|
|
|
|
+ nftnl_xfree(log->prefix);
|
|
|
|
|
|
|
|
log->prefix = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -152,7 +152,7 @@ nftnl_expr_log_parse(struct nftnl_expr *e, struct nlattr *attr)
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
if (tb[NFTA_LOG_PREFIX]) {
|
|
|
|
if (log->prefix)
|
|
|
|
- xfree(log->prefix);
|
|
|
|
+ nftnl_xfree(log->prefix);
|
|
|
|
|
|
|
|
log->prefix = strdup(mnl_attr_get_str(tb[NFTA_LOG_PREFIX]));
|
2015-10-02 16:20:59 +02:00
|
|
|
e->flags |= (1 << NFTNL_EXPR_LOG_PREFIX);
|
|
|
|
@@ -329,7 +329,7 @@ static void nftnl_expr_log_free(struct nftnl_expr *e)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
2015-10-02 16:20:59 +02:00
|
|
|
struct nftnl_expr_log *log = nftnl_expr_data(e);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
- xfree(log->prefix);
|
|
|
|
+ nftnl_xfree(log->prefix);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct expr_ops expr_ops_log = {
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/expr/match.c b/src/expr/match.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index ddecb43..2071b3c 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/expr/match.c
|
|
|
|
+++ b/src/expr/match.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -50,7 +50,7 @@ nftnl_expr_match_set(struct nftnl_expr *e, uint16_t type,
|
2014-08-16 15:35:48 +02:00
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_EXPR_MT_INFO:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (mt->data)
|
|
|
|
- xfree(mt->data);
|
|
|
|
+ nftnl_xfree(mt->data);
|
|
|
|
|
|
|
|
mt->data = data;
|
|
|
|
mt->data_len = data_len;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -147,7 +147,7 @@ static int nftnl_expr_match_parse(struct nftnl_expr *e, struct nlattr *attr)
|
2014-08-16 15:35:48 +02:00
|
|
|
void *match_data;
|
|
|
|
|
|
|
|
if (match->data)
|
|
|
|
- xfree(match->data);
|
|
|
|
+ nftnl_xfree(match->data);
|
|
|
|
|
|
|
|
match_data = calloc(1, len);
|
|
|
|
if (match_data == NULL)
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -237,7 +237,7 @@ static void nftnl_expr_match_free(struct nftnl_expr *e)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
2015-10-02 16:20:59 +02:00
|
|
|
struct nftnl_expr_match *match = nftnl_expr_data(e);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
- xfree(match->data);
|
|
|
|
+ nftnl_xfree(match->data);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct expr_ops expr_ops_match = {
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/expr/target.c b/src/expr/target.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index cbbee60..064f56a 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/expr/target.c
|
|
|
|
+++ b/src/expr/target.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -50,7 +50,7 @@ nftnl_expr_target_set(struct nftnl_expr *e, uint16_t type,
|
2014-08-16 15:35:48 +02:00
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_EXPR_TG_INFO:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (tg->data)
|
|
|
|
- xfree(tg->data);
|
|
|
|
+ nftnl_xfree(tg->data);
|
|
|
|
|
|
|
|
tg->data = data;
|
|
|
|
tg->data_len = data_len;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -147,7 +147,7 @@ static int nftnl_expr_target_parse(struct nftnl_expr *e, struct nlattr *attr)
|
2014-08-16 15:35:48 +02:00
|
|
|
void *target_data;
|
|
|
|
|
|
|
|
if (target->data)
|
|
|
|
- xfree(target->data);
|
|
|
|
+ nftnl_xfree(target->data);
|
|
|
|
|
|
|
|
target_data = calloc(1, len);
|
|
|
|
if (target_data == NULL)
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -238,7 +238,7 @@ static void nftnl_expr_target_free(struct nftnl_expr *e)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
2015-10-02 16:20:59 +02:00
|
|
|
struct nftnl_expr_target *target = nftnl_expr_data(e);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
- xfree(target->data);
|
|
|
|
+ nftnl_xfree(target->data);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct expr_ops expr_ops_target = {
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/gen.c b/src/gen.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index eb3b70d..dac3e47 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/gen.c
|
|
|
|
+++ b/src/gen.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -37,7 +37,7 @@ EXPORT_SYMBOL(nftnl_gen_alloc, nft_gen_alloc);
|
2014-12-16 12:42:57 +01:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
void nftnl_gen_free(struct nftnl_gen *gen)
|
2014-12-16 12:42:57 +01:00
|
|
|
{
|
|
|
|
- xfree(gen);
|
|
|
|
+ nftnl_xfree(gen);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_gen_free, nft_gen_free);
|
2014-12-16 12:42:57 +01:00
|
|
|
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/mxml.c b/src/mxml.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index 51dbf1b..5b2aa57 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/mxml.c
|
|
|
|
+++ b/src/mxml.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -85,7 +85,7 @@ struct nftnl_expr *nftnl_mxml_expr_parse(mxml_node_t *node,
|
2014-08-16 15:35:48 +02:00
|
|
|
goto err_expr;
|
|
|
|
|
|
|
|
tree = mxmlLoadString(NULL, xml_text, MXML_OPAQUE_CALLBACK);
|
|
|
|
- xfree(xml_text);
|
|
|
|
+ nftnl_xfree(xml_text);
|
|
|
|
|
|
|
|
if (tree == NULL)
|
|
|
|
goto err_expr;
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/rule.c b/src/rule.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index 0fb27ed..f8e33ff 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/rule.c
|
|
|
|
+++ b/src/rule.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -72,11 +72,11 @@ void nftnl_rule_free(struct nftnl_rule *r)
|
|
|
|
nftnl_expr_free(e);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
if (r->table != NULL)
|
|
|
|
- xfree(r->table);
|
|
|
|
+ nftnl_xfree(r->table);
|
|
|
|
if (r->chain != NULL)
|
|
|
|
- xfree(r->chain);
|
|
|
|
+ nftnl_xfree(r->chain);
|
|
|
|
|
|
|
|
- xfree(r);
|
|
|
|
+ nftnl_xfree(r);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_rule_free, nft_rule_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -94,13 +94,13 @@ void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
|
2014-08-16 15:35:48 +02:00
|
|
|
switch (attr) {
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_RULE_TABLE:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (r->table) {
|
|
|
|
- xfree(r->table);
|
|
|
|
+ nftnl_xfree(r->table);
|
|
|
|
r->table = NULL;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_RULE_CHAIN:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (r->chain) {
|
|
|
|
- xfree(r->chain);
|
|
|
|
+ nftnl_xfree(r->chain);
|
|
|
|
r->chain = NULL;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -136,13 +136,13 @@ void nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
|
2014-08-16 15:35:48 +02:00
|
|
|
switch(attr) {
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_RULE_TABLE:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (r->table)
|
|
|
|
- xfree(r->table);
|
|
|
|
+ nftnl_xfree(r->table);
|
|
|
|
|
|
|
|
r->table = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_RULE_CHAIN:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (r->chain)
|
|
|
|
- xfree(r->chain);
|
|
|
|
+ nftnl_xfree(r->chain);
|
|
|
|
|
|
|
|
r->chain = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -425,12 +425,12 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
|
|
|
|
return -1;
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
if (tb[NFTA_RULE_TABLE]) {
|
|
|
|
- xfree(r->table);
|
|
|
|
+ nftnl_xfree(r->table);
|
|
|
|
r->table = strdup(mnl_attr_get_str(tb[NFTA_RULE_TABLE]));
|
|
|
|
r->flags |= (1 << NFTNL_RULE_TABLE);
|
|
|
|
}
|
|
|
|
if (tb[NFTA_RULE_CHAIN]) {
|
|
|
|
- xfree(r->chain);
|
|
|
|
+ nftnl_xfree(r->chain);
|
|
|
|
r->chain = strdup(mnl_attr_get_str(tb[NFTA_RULE_CHAIN]));
|
|
|
|
r->flags |= (1 << NFTNL_RULE_CHAIN);
|
2014-08-16 15:35:48 +02:00
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -451,7 +451,7 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
|
2014-08-16 15:35:48 +02:00
|
|
|
mnl_attr_get_payload(tb[NFTA_RULE_USERDATA]);
|
|
|
|
|
|
|
|
if (r->user.data)
|
|
|
|
- xfree(r->user.data);
|
|
|
|
+ nftnl_xfree(r->user.data);
|
|
|
|
|
|
|
|
r->user.len = mnl_attr_get_payload_len(tb[NFTA_RULE_USERDATA]);
|
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -1042,7 +1042,7 @@ EXPORT_SYMBOL(nftnl_expr_iter_next, nft_rule_expr_iter_next);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
void nftnl_expr_iter_destroy(struct nftnl_expr_iter *iter)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
|
|
|
- xfree(iter);
|
|
|
|
+ nftnl_xfree(iter);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_expr_iter_destroy, nft_rule_expr_iter_destroy);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -1072,7 +1072,7 @@ void nftnl_rule_list_free(struct nftnl_rule_list *list)
|
2014-08-16 15:35:48 +02:00
|
|
|
list_del(&r->head);
|
2015-10-02 16:20:59 +02:00
|
|
|
nftnl_rule_free(r);
|
2014-08-16 15:35:48 +02:00
|
|
|
}
|
|
|
|
- xfree(list);
|
|
|
|
+ nftnl_xfree(list);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_rule_list_free, nft_rule_list_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -1163,6 +1163,6 @@ EXPORT_SYMBOL(nftnl_rule_list_iter_next, nft_rule_list_iter_next);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
void nftnl_rule_list_iter_destroy(struct nftnl_rule_list_iter *iter)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
|
|
|
- xfree(iter);
|
|
|
|
+ nftnl_xfree(iter);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_rule_list_iter_destroy, nft_rule_list_iter_destroy);
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/ruleset.c b/src/ruleset.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index 7b1ab7a..b8188de 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/ruleset.c
|
|
|
|
+++ b/src/ruleset.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -74,7 +74,7 @@ void nftnl_ruleset_free(struct nftnl_ruleset *r)
|
|
|
|
nftnl_set_list_free(r->set_list);
|
|
|
|
if (r->flags & (1 << NFTNL_RULESET_RULELIST))
|
|
|
|
nftnl_rule_list_free(r->rule_list);
|
2014-08-16 15:35:48 +02:00
|
|
|
- xfree(r);
|
|
|
|
+ nftnl_xfree(r);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_ruleset_free, nft_ruleset_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/set.c b/src/set.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index f5a9454..4eff325 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/set.c
|
|
|
|
+++ b/src/set.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -45,15 +45,15 @@ void nftnl_set_free(struct nftnl_set *s)
|
|
|
|
struct nftnl_set_elem *elem, *tmp;
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
if (s->table != NULL)
|
|
|
|
- xfree(s->table);
|
|
|
|
+ nftnl_xfree(s->table);
|
|
|
|
if (s->name != NULL)
|
|
|
|
- xfree(s->name);
|
|
|
|
+ nftnl_xfree(s->name);
|
|
|
|
|
|
|
|
list_for_each_entry_safe(elem, tmp, &s->element_list, head) {
|
|
|
|
list_del(&elem->head);
|
2015-10-02 16:20:59 +02:00
|
|
|
nftnl_set_elem_free(elem);
|
2014-08-16 15:35:48 +02:00
|
|
|
}
|
|
|
|
- xfree(s);
|
|
|
|
+ nftnl_xfree(s);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_set_free, nft_set_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -69,14 +69,14 @@ void nftnl_set_unset(struct nftnl_set *s, uint16_t attr)
|
|
|
|
case NFTNL_SET_TABLE:
|
|
|
|
if (s->flags & (1 << NFTNL_SET_TABLE))
|
2014-08-16 15:35:48 +02:00
|
|
|
if (s->table) {
|
|
|
|
- xfree(s->table);
|
|
|
|
+ nftnl_xfree(s->table);
|
|
|
|
s->table = NULL;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_SET_NAME:
|
|
|
|
if (s->flags & (1 << NFTNL_SET_NAME))
|
2014-08-16 15:35:48 +02:00
|
|
|
if (s->name) {
|
|
|
|
- xfree(s->name);
|
|
|
|
+ nftnl_xfree(s->name);
|
|
|
|
s->name = NULL;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -124,13 +124,13 @@ void nftnl_set_set_data(struct nftnl_set *s, uint16_t attr, const void *data,
|
2014-08-16 15:35:48 +02:00
|
|
|
switch(attr) {
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_SET_TABLE:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (s->table)
|
|
|
|
- xfree(s->table);
|
|
|
|
+ nftnl_xfree(s->table);
|
|
|
|
|
|
|
|
s->table = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_SET_NAME:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (s->name)
|
|
|
|
- xfree(s->name);
|
|
|
|
+ nftnl_xfree(s->name);
|
|
|
|
|
|
|
|
s->name = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -435,12 +435,12 @@ int nftnl_set_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (tb[NFTA_SET_TABLE]) {
|
|
|
|
- xfree(s->table);
|
|
|
|
+ nftnl_xfree(s->table);
|
|
|
|
s->table = strdup(mnl_attr_get_str(tb[NFTA_SET_TABLE]));
|
|
|
|
s->flags |= (1 << NFTNL_SET_TABLE);
|
|
|
|
}
|
|
|
|
if (tb[NFTA_SET_NAME]) {
|
|
|
|
- xfree(s->name);
|
|
|
|
+ nftnl_xfree(s->name);
|
|
|
|
s->name = strdup(mnl_attr_get_str(tb[NFTA_SET_NAME]));
|
|
|
|
s->flags |= (1 << NFTNL_SET_NAME);
|
|
|
|
}
|
|
|
|
@@ -1085,7 +1085,7 @@ void nftnl_set_list_free(struct nftnl_set_list *list)
|
2014-08-16 15:35:48 +02:00
|
|
|
list_del(&s->head);
|
2015-10-02 16:20:59 +02:00
|
|
|
nftnl_set_free(s);
|
2014-08-16 15:35:48 +02:00
|
|
|
}
|
|
|
|
- xfree(list);
|
|
|
|
+ nftnl_xfree(list);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_set_list_free, nft_set_list_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -1175,7 +1175,7 @@ EXPORT_SYMBOL(nftnl_set_list_iter_next, nft_set_list_iter_next);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
void nftnl_set_list_iter_destroy(struct nftnl_set_list_iter *iter)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
|
|
|
- xfree(iter);
|
|
|
|
+ nftnl_xfree(iter);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_set_list_iter_destroy, nft_set_list_iter_destroy);
|
2014-12-16 12:42:57 +01:00
|
|
|
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/set_elem.c b/src/set_elem.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index 293ce15..4e20159 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/set_elem.c
|
|
|
|
+++ b/src/set_elem.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -43,7 +43,7 @@ void nftnl_set_elem_free(struct nftnl_set_elem *s)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
2015-10-02 16:20:59 +02:00
|
|
|
if (s->flags & (1 << NFTNL_SET_ELEM_CHAIN)) {
|
2014-08-16 15:35:48 +02:00
|
|
|
if (s->data.chain) {
|
|
|
|
- xfree(s->data.chain);
|
|
|
|
+ nftnl_xfree(s->data.chain);
|
|
|
|
s->data.chain = NULL;
|
|
|
|
}
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -51,7 +51,7 @@ void nftnl_set_elem_free(struct nftnl_set_elem *s)
|
|
|
|
if (s->flags & (1 << NFTNL_SET_ELEM_EXPR))
|
|
|
|
nftnl_expr_free(s->expr);
|
|
|
|
|
2014-08-16 15:35:48 +02:00
|
|
|
- xfree(s);
|
|
|
|
+ nftnl_xfree(s);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_set_elem_free, nft_set_elem_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -67,7 +67,7 @@ void nftnl_set_elem_unset(struct nftnl_set_elem *s, uint16_t attr)
|
|
|
|
case NFTNL_SET_ELEM_CHAIN:
|
|
|
|
if (s->flags & (1 << NFTNL_SET_ELEM_CHAIN)) {
|
2014-08-16 15:35:48 +02:00
|
|
|
if (s->data.chain) {
|
|
|
|
- xfree(s->data.chain);
|
|
|
|
+ nftnl_xfree(s->data.chain);
|
|
|
|
s->data.chain = NULL;
|
|
|
|
}
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -110,7 +110,7 @@ void nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr,
|
2014-08-16 15:35:48 +02:00
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_SET_ELEM_CHAIN: /* NFTA_SET_ELEM_DATA */
|
2014-08-16 15:35:48 +02:00
|
|
|
if (s->data.chain)
|
|
|
|
- xfree(s->data.chain);
|
|
|
|
+ nftnl_xfree(s->data.chain);
|
|
|
|
|
|
|
|
s->data.chain = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -390,7 +390,7 @@ static int nftnl_set_elems_parse2(struct nftnl_set *s, const struct nlattr *nest
|
|
|
|
mnl_attr_get_payload(tb[NFTA_SET_ELEM_USERDATA]);
|
|
|
|
|
|
|
|
if (e->user.data)
|
|
|
|
- xfree(e->user.data);
|
|
|
|
+ nftnl_xfree(e->user.data);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
e->user.len = mnl_attr_get_payload_len(tb[NFTA_SET_ELEM_USERDATA]);
|
|
|
|
e->user.data = malloc(e->user.len);
|
|
|
|
@@ -462,13 +462,13 @@ int nftnl_set_elems_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (tb[NFTA_SET_ELEM_LIST_TABLE]) {
|
|
|
|
- xfree(s->table);
|
|
|
|
+ nftnl_xfree(s->table);
|
|
|
|
s->table =
|
|
|
|
strdup(mnl_attr_get_str(tb[NFTA_SET_ELEM_LIST_TABLE]));
|
|
|
|
s->flags |= (1 << NFTNL_SET_TABLE);
|
|
|
|
}
|
|
|
|
if (tb[NFTA_SET_ELEM_LIST_SET]) {
|
|
|
|
- xfree(s->name);
|
|
|
|
+ nftnl_xfree(s->name);
|
|
|
|
s->name =
|
|
|
|
strdup(mnl_attr_get_str(tb[NFTA_SET_ELEM_LIST_SET]));
|
|
|
|
s->flags |= (1 << NFTNL_SET_NAME);
|
|
|
|
@@ -853,7 +853,7 @@ EXPORT_SYMBOL(nftnl_set_elems_iter_next, nft_set_elems_iter_next);
|
|
|
|
|
|
|
|
void nftnl_set_elems_iter_destroy(struct nftnl_set_elems_iter *iter)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
|
|
|
- xfree(iter);
|
|
|
|
+ nftnl_xfree(iter);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_set_elems_iter_destroy, nft_set_elems_iter_destroy);
|
2014-12-16 12:42:57 +01:00
|
|
|
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/table.c b/src/table.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index 28f6bd6..6aa2eb5 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/table.c
|
|
|
|
+++ b/src/table.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -45,9 +45,9 @@ EXPORT_SYMBOL(nftnl_table_alloc, nft_table_alloc);
|
|
|
|
void nftnl_table_free(struct nftnl_table *t)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
2015-10-02 16:20:59 +02:00
|
|
|
if (t->flags & (1 << NFTNL_TABLE_NAME))
|
2014-08-16 15:35:48 +02:00
|
|
|
- xfree(t->name);
|
|
|
|
+ nftnl_xfree(t->name);
|
|
|
|
|
|
|
|
- xfree(t);
|
|
|
|
+ nftnl_xfree(t);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_table_free, nft_table_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -65,7 +65,7 @@ void nftnl_table_unset(struct nftnl_table *t, uint16_t attr)
|
2014-08-16 15:35:48 +02:00
|
|
|
switch (attr) {
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_TABLE_NAME:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (t->name) {
|
|
|
|
- xfree(t->name);
|
|
|
|
+ nftnl_xfree(t->name);
|
|
|
|
t->name = NULL;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -95,7 +95,7 @@ void nftnl_table_set_data(struct nftnl_table *t, uint16_t attr,
|
2014-08-16 15:35:48 +02:00
|
|
|
switch (attr) {
|
2015-10-02 16:20:59 +02:00
|
|
|
case NFTNL_TABLE_NAME:
|
2014-08-16 15:35:48 +02:00
|
|
|
if (t->name)
|
|
|
|
- xfree(t->name);
|
|
|
|
+ nftnl_xfree(t->name);
|
|
|
|
|
|
|
|
t->name = strdup(data);
|
|
|
|
break;
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -229,7 +229,7 @@ int nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (tb[NFTA_TABLE_NAME]) {
|
|
|
|
- xfree(t->name);
|
|
|
|
+ nftnl_xfree(t->name);
|
|
|
|
t->name = strdup(mnl_attr_get_str(tb[NFTA_TABLE_NAME]));
|
|
|
|
t->flags |= (1 << NFTNL_TABLE_NAME);
|
|
|
|
}
|
|
|
|
@@ -496,7 +496,7 @@ void nftnl_table_list_free(struct nftnl_table_list *list)
|
2014-08-16 15:35:48 +02:00
|
|
|
list_del(&r->head);
|
2015-10-02 16:20:59 +02:00
|
|
|
nftnl_table_free(r);
|
2014-08-16 15:35:48 +02:00
|
|
|
}
|
|
|
|
- xfree(list);
|
|
|
|
+ nftnl_xfree(list);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_table_list_free, nft_table_list_free);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -581,6 +581,6 @@ EXPORT_SYMBOL(nftnl_table_list_iter_next, nft_table_list_iter_next);
|
2014-08-16 15:35:48 +02:00
|
|
|
|
2015-10-02 16:20:59 +02:00
|
|
|
void nftnl_table_list_iter_destroy(struct nftnl_table_list_iter *iter)
|
2014-08-16 15:35:48 +02:00
|
|
|
{
|
|
|
|
- xfree(iter);
|
|
|
|
+ nftnl_xfree(iter);
|
|
|
|
}
|
2015-10-02 16:20:59 +02:00
|
|
|
EXPORT_SYMBOL(nftnl_table_list_iter_destroy, nft_table_list_iter_destroy);
|
2014-12-29 15:38:14 +01:00
|
|
|
diff --git a/src/utils.c b/src/utils.c
|
2015-10-02 16:20:59 +02:00
|
|
|
index c241e5f..ba44a60 100644
|
2014-12-29 15:38:14 +01:00
|
|
|
--- a/src/utils.c
|
|
|
|
+++ b/src/utils.c
|
2015-10-02 16:20:59 +02:00
|
|
|
@@ -249,7 +249,7 @@ int nftnl_fprintf(FILE *fp, void *obj, uint32_t cmd, uint32_t type, uint32_t fla
|
2014-08-16 15:35:48 +02:00
|
|
|
|
|
|
|
out:
|
|
|
|
if (buf != _buf)
|
|
|
|
- xfree(buf);
|
|
|
|
+ nftnl_xfree(buf);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2014-12-29 15:38:14 +01:00
|
|
|
--
|
2015-10-02 16:20:59 +02:00
|
|
|
2.4.9
|
2014-12-29 15:38:14 +01:00
|
|
|
|