This chain type string is released via chain_free() since
b7cb6915a88f,
so duplicate it so we don't try to release statically allocated memory.
Fixes: b7cb6915a88f ("rule: Remove memory leak")
Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
hook_spec : TYPE STRING HOOK STRING dev_spec PRIORITY prio_spec
{
- $<chain>0->type = chain_type_name_lookup($2);
+ $<chain>0->type = xstrdup(chain_type_name_lookup($2));
if ($<chain>0->type == NULL) {
erec_queue(error(&@2, "unknown chain type %s", $2),
state->msgs);