diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-08-14 11:10:58 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-08-14 11:14:11 +0200 |
commit | a5c387def7981fd5b2e48759d3d1ca489cdfefcf (patch) | |
tree | 91cdfee76d0c0abd7435fe4a0aac7a793f2e4670 /src/expr | |
parent | 03886d5908fe4ba44a056d8297cc7b48c91a8f15 (diff) |
src: xml: don't duplicate string in nft_table_xml_parse
With this patch, nft_table_xml_parse does not duplicate the string
anymore, which is what most callers seem to need. This fixes memleaks
in several places in the code. Thus, this patch also adapts the code
to duplicate it when needed.
Based on patch from Arturo Borrero.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr')
-rw-r--r-- | src/expr/log.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr/log.c b/src/expr/log.c index 14785fd..291502b 100644 --- a/src/expr/log.c +++ b/src/expr/log.c @@ -162,7 +162,7 @@ static int nft_rule_expr_log_xml_parse(struct nft_rule_expr *e, mxml_node_t *tre if (prefix == NULL) return -1; - log->prefix = prefix; + log->prefix = strdup(prefix); e->flags |= (1 << NFT_EXPR_LOG_PREFIX); if (nft_mxml_num_parse(tree, "group", MXML_DESCEND_FIRST, BASE_DEC, |