From: jsg Date: Wed, 14 Feb 2024 02:40:02 +0000 (+0000) Subject: avoid use after free of fcode X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d7403039963a2bffc0abb1b2a77624fb81be8b63;p=openbsd avoid use after free of fcode found by smatch, fix from deraadt@ ok miod@ --- 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);