From 20ede88a51cf99dfaec539f13149a81d67a98a69 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 15 Mar 2016 17:11:03 +0100 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser_bison.y') 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 { - $0->type = chain_type_name_lookup($2); + $0->type = xstrdup(chain_type_name_lookup($2)); if ($0->type == NULL) { erec_queue(error(&@2, "unknown chain type %s", $2), state->msgs); -- cgit v1.2.3