All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nft] optimize: segfault when releasing unsupported statement
@ 2022-06-01  8:16 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2022-06-01  8:16 UTC (permalink / raw)
  To: netfilter-devel

Call xfree() instead since stmt_alloc() does not initialize the
statement type fields.

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1609
Fixes: ea1f1c9ff608 ("optimize: memleak in statement matrix")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/optimize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/optimize.c b/src/optimize.c
index d6dfffec3c86..3a3049d43690 100644
--- a/src/optimize.c
+++ b/src/optimize.c
@@ -304,7 +304,7 @@ static int rule_collect_stmts(struct optimize_ctx *ctx, struct rule *rule)
 			clone->nat.type_flags = stmt->nat.type_flags;
 			break;
 		default:
-			stmt_free(clone);
+			xfree(clone);
 			continue;
 		}
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-01  8:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-01  8:16 [PATCH nft] optimize: segfault when releasing unsupported statement Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.