From 0cc4cc98135796a89c58cae936f5a8ea9518a206 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Thu, 26 Dec 2024 10:42:11 -0300 Subject: [PATCH] fix double free --- vlib/v/gen/c/cgen.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index 4dfc2e7b3e6a34..6b99c2b583657b 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -3386,6 +3386,9 @@ fn (mut g Gen) autofree_scope_vars2(scope &ast.Scope, start_pos int, end_pos int // Do not free vars that were declared after this scope continue } + if obj.expr is ast.IfGuardExpr { + continue + } g.autofree_variable(obj) } else {}