parse: lex: fix memory leaks

This commit is contained in:
2026-05-30 19:50:38 +01:00
parent fec3be2140
commit 5d6f2a5ce8
4 changed files with 22 additions and 11 deletions
+2
View File
@@ -41,6 +41,8 @@ void bshell_lex_token_destroy(struct bshell_lex_token *tok)
switch (tok->tok_type) {
case BSHELL_TOK_WORD:
case BSHELL_TOK_FLAG:
case BSHELL_TOK_VAR:
case BSHELL_TOK_VAR_SPLAT:
case BSHELL_TOK_STRING:
if (tok->tok_str) {
free(tok->tok_str);