Blame SOURCES/0059-parser_bison-free-chain-name-after-creating-constant.patch

bacbc8
From 8bd95db6d02b8ed268f2bfb7ec62b4d0cfbf82ad Mon Sep 17 00:00:00 2001
bacbc8
From: Pablo Neira Ayuso <pablo@netfilter.org>
bacbc8
Date: Mon, 10 Jun 2019 19:23:40 +0200
bacbc8
Subject: [PATCH] parser_bison: free chain name after creating constant
bacbc8
 expression
bacbc8
bacbc8
==2330== 2 bytes in 1 blocks are definitely lost in loss record 1 of 1
bacbc8
==2330==    at 0x4C2BBAF: malloc (vg_replace_malloc.c:299)
bacbc8
==2330==    by 0x583D3B9: strdup (strdup.c:42)
bacbc8
==2330==    by 0x4E7966D: xstrdup (utils.c:75)
bacbc8
==2330==    by 0x4E9C283: nft_lex (scanner.l:626)
bacbc8
==2330==    by 0x4E8E3C2: nft_parse (parser_bison.c:5297)
bacbc8
==2330==    by 0x4E7EAB2: nft_parse_bison_filename (libnftables.c:374)
bacbc8
==2330==    by 0x4E7EAB2: nft_run_cmd_from_filename (libnftables.c:475)
bacbc8
==2330==    by 0x109A53: main (main.c:310)
bacbc8
bacbc8
Fixes: f1e8a129ee42 ("src: Introduce chain_expr in jump and goto statements")
bacbc8
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
bacbc8
(cherry picked from commit 29d0b6b0526ed9b661db9f1c8dbd2abbff11483a)
bacbc8
Signed-off-by: Phil Sutter <psutter@redhat.com>
bacbc8
---
bacbc8
 src/parser_bison.y | 1 +
bacbc8
 1 file changed, 1 insertion(+)
bacbc8
bacbc8
diff --git a/src/parser_bison.y b/src/parser_bison.y
bacbc8
index 4bd1ae1e39855..cea5d7660ba4c 100644
bacbc8
--- a/src/parser_bison.y
bacbc8
+++ b/src/parser_bison.y
bacbc8
@@ -3482,6 +3482,7 @@ chain_expr		:	variable_expr
bacbc8
 							 BYTEORDER_HOST_ENDIAN,
bacbc8
 							 strlen($1) * BITS_PER_BYTE,
bacbc8
 							 $1);
bacbc8
+				xfree($1);
bacbc8
 			}
bacbc8
 			;
bacbc8
 
bacbc8
-- 
bacbc8
2.21.0
bacbc8