From d7403039963a2bffc0abb1b2a77624fb81be8b63 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 14 Feb 2024 02:40:02 +0000 Subject: [PATCH] avoid use after free of fcode found by smatch, fix from deraadt@ ok miod@ --- usr.bin/fgen/fgen.l | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/fgen/fgen.l b/usr.bin/fgen/fgen.l index bce0267e45e..994cf6db276 100644 --- a/usr.bin/fgen/fgen.l +++ b/usr.bin/fgen/fgen.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: fgen.l,v 1.16 2023/11/10 16:02:47 jasper Exp $ */ +/* $OpenBSD: fgen.l,v 1.17 2024/02/14 02:40:02 jsg Exp $ */ /* $NetBSD: fgen.l,v 1.37 2016/03/08 20:13:44 christos Exp $ */ /* FLEX input for FORTH input file scanner */ /* @@ -1264,6 +1264,7 @@ tokenize(YY_BUFFER_STATE yinput) token->text); free((void *)fcode->name); free(fcode); + break; } if (debug) printf("Adding %s to dictionary\n", token->text); -- 2.20.1