path: root/src/table.c
diff options
authorPablo Neira Ayuso <>2013-08-14 11:10:58 +0200
committerPablo Neira Ayuso <>2013-08-14 11:14:11 +0200
commita5c387def7981fd5b2e48759d3d1ca489cdfefcf (patch)
tree91cdfee76d0c0abd7435fe4a0aac7a793f2e4670 /src/table.c
parent03886d5908fe4ba44a056d8297cc7b48c91a8f15 (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 <>
Diffstat (limited to 'src/table.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/table.c b/src/table.c
index 1fa0dac..26bf60d 100644
--- a/src/table.c
+++ b/src/table.c
@@ -239,7 +239,7 @@ static int nft_table_xml_parse(struct nft_table *t, char *xml)
if (t->name)
- t->name = name;
+ t->name = strdup(name);
t->flags |= (1 << NFT_TABLE_ATTR_NAME);
family = nft_mxml_family_parse(tree, "family", MXML_DESCEND_FIRST);