diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-08-06 11:33:45 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-08-06 11:33:45 +0200 |
commit | 99d25746b94b602f7b0f2381b73e0f52d11fca31 (patch) | |
tree | 0fa195f88207a21a464c814d3ae3e24d03fba6dd /src/expr/match.c | |
parent | 19925e0fbc1d709212ed82fe4e43fe6ef1ec3539 (diff) |
src: add xfree and use it
This patch adds xfree, a replacement of free that accepts
const pointers. This helps to remove ugly castings that you usually
need to calm down gcc.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr/match.c')
-rw-r--r-- | src/expr/match.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/expr/match.c b/src/expr/match.c index 9eb31c5..d155bb3 100644 --- a/src/expr/match.c +++ b/src/expr/match.c @@ -50,7 +50,7 @@ nft_rule_expr_match_set(struct nft_rule_expr *e, uint16_t type, break; case NFT_EXPR_MT_INFO: if (mt->data) - free((void *)mt->data); + xfree(mt->data); mt->data = data; mt->data_len = data_len; @@ -153,7 +153,7 @@ static int nft_rule_expr_match_parse(struct nft_rule_expr *e, struct nlattr *att void *match_data; if (match->data) - free((void *) match->data); + xfree(match->data); match_data = calloc(1, len); if (match_data == NULL) |