From 99d25746b94b602f7b0f2381b73e0f52d11fca31 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 6 Aug 2013 11:33:45 +0200 Subject: 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 --- src/expr/match.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/expr/match.c') 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) -- cgit v1.2.3