netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft 1/3] parser_bison: release extended priority string after parsing
@ 2020-05-05 19:05 Pablo Neira Ayuso
  2020-05-05 19:05 ` [PATCH nft 2/3] parser_bison: release helper type " Pablo Neira Ayuso
  2020-05-05 19:05 ` [PATCH nft 3/3] src: ct_timeout: release policy string and state list Pablo Neira Ayuso
  0 siblings, 2 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2020-05-05 19:05 UTC (permalink / raw)
  To: netfilter-devel

==29581==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 1034 byte(s) in 152 object(s) allocated from:
    #0 0x7f7b55f1b810 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
    #1 0x7f7b559597e0 in xstrdup /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:75
    #2 0x7f7b55a494a0 in nft_lex /home/pablo/devel/scm/git-netfilter/nftables/src/scanner.l:641
    #3 0x7f7b559cec25 in nft_parse /home/pablo/devel/scm/git-netfilter/nftables/src/parser_bison.c:5792
    #4 0x7f7b5597e318 in nft_parse_bison_filename /home/pablo/devel/scm/git-netfilter/nftables/src/libnftables.c:392
    #5 0x7f7b5597f864 in nft_run_cmd_from_filename /home/pablo/devel/scm/git-netfilter/nftables/src/libnftables.c:495
    #6 0x562a25bbce71 in main /home/pablo/devel/scm/git-netfilter/nftables/src/main.c:457
    #7 0x7f7b5457509a in __libc_start_main ../csu/libc-start.c:308

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/parser_bison.y | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index 3cd0559b2912..0190dbb88c97 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -2167,6 +2167,7 @@ extended_prio_spec	:	int_num
 								BYTEORDER_HOST_ENDIAN,
 								strlen(str) * BITS_PER_BYTE,
 								str);
+				xfree($1);
 				$$ = spec;
 			}
 			;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH nft 2/3] parser_bison: release helper type string after parsing
  2020-05-05 19:05 [PATCH nft 1/3] parser_bison: release extended priority string after parsing Pablo Neira Ayuso
@ 2020-05-05 19:05 ` Pablo Neira Ayuso
  2020-05-05 19:05 ` [PATCH nft 3/3] src: ct_timeout: release policy string and state list Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2020-05-05 19:05 UTC (permalink / raw)
  To: netfilter-devel

==4060==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x7f637b64a810 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
    #1 0x7f637b17766d in xstrdup /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:75
    #2 0x7f637b1ddce9 in nft_parse /home/pablo/devel/scm/git-netfilter/nftables/src/parser_bison.c:5792

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/parser_bison.y | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/parser_bison.y b/src/parser_bison.y
index 0190dbb88c97..4369ece60ed0 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -3903,6 +3903,7 @@ ct_helper_config		:	TYPE	QUOTED_STRING	PROTOCOL	ct_l4protoname	stmt_separator
 					erec_queue(error(&@2, "invalid name '%s', max length is %u\n", $2, (int)sizeof(ct->name)), state->msgs);
 					YYERROR;
 				}
+				xfree($2);
 
 				ct->l4proto = $4;
 			}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH nft 3/3] src: ct_timeout: release policy string and state list
  2020-05-05 19:05 [PATCH nft 1/3] parser_bison: release extended priority string after parsing Pablo Neira Ayuso
  2020-05-05 19:05 ` [PATCH nft 2/3] parser_bison: release helper type " Pablo Neira Ayuso
@ 2020-05-05 19:05 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2020-05-05 19:05 UTC (permalink / raw)
  To: netfilter-devel

=================================================================
==19037==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 18 byte(s) in 2 object(s) allocated from:
    #0 0x7ff6ee6f9810 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
    #1 0x7ff6ee22666d in xstrdup /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:75
    #2 0x7ff6ee28cce9 in nft_parse /home/pablo/devel/scm/git-netfilter/nftables/src/parser_bison.c:5792
    #3 0x4b903f302c8010a  (<unknown module>)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7ff6ee7a8330 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x7ff6ee226578 in xmalloc /home/pablo/devel/scm/git-netfilter/nftables/src/utils.c:36

SUMMARY: AddressSanitizer: 34 byte(s) leaked in 3 allocation(s).

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/evaluate.c     | 1 +
 src/parser_bison.y | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/evaluate.c b/src/evaluate.c
index 4cf28987049b..9aa283fd2e12 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -3902,6 +3902,7 @@ static int ct_timeout_evaluate(struct eval_ctx *ctx, struct obj *obj)
 
 		ct->timeout[ts->timeout_index] = ts->timeout_value;
 		list_del(&ts->head);
+		xfree(ts->timeout_str);
 		xfree(ts);
 	}
 
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 4369ece60ed0..39d3eac83b16 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -3954,6 +3954,7 @@ ct_timeout_config	:	PROTOCOL	ct_l4protoname	stmt_separator
 
 				ct = &$<obj>0->ct_timeout;
 				list_splice_tail($4, &ct->timeout_list);
+				xfree($4);
 			}
 			|	L3PROTOCOL	family_spec_explicit	stmt_separator
 			{
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-05 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 19:05 [PATCH nft 1/3] parser_bison: release extended priority string after parsing Pablo Neira Ayuso
2020-05-05 19:05 ` [PATCH nft 2/3] parser_bison: release helper type " Pablo Neira Ayuso
2020-05-05 19:05 ` [PATCH nft 3/3] src: ct_timeout: release policy string and state list Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).