sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit 69d08810f5633d4dd1ac2b486fa96f29123b0a37
parent e43f97dba453bde1833e5c25a9af2d2b0eaf2e0c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Wed, 26 Nov 2025 08:54:02 +0100

bc: Use strdup for STRING

The attribute of the STRING terminal symbol was a constant string
that couldn't be passed to free().

Diffstat:
Mbc.y | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bc.y b/bc.y @@ -588,7 +588,7 @@ string(int ch) if (bp == &yytext[BUFSIZ]) yyerror("too long string"); *bp = '\0'; - yylval.str = yytext; + yylval.str = estrdup(yytext); return STRING; }