diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-03-15 17:11:03 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-03-15 17:32:19 +0100 |
commit | 20ede88a51cf99dfaec539f13149a81d67a98a69 (patch) | |
tree | 60ccdad9b08f16f76460ced0452ed8dd61bc79d2 /src/parser_bison.y | |
parent | 6df0261c5cec232d3b37c553d62d148b3d8805e5 (diff) |
parser_bison: duplicate string returned by chain_type_name_lookup()
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>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index 24c09698..0592b682 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -1101,7 +1101,7 @@ type_identifier : STRING { $$ = $1; } 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); |