Fix a few memory leaks.

This commit is contained in:
nicm
2021-08-23 11:04:21 +00:00
parent 3ed37a2079
commit 4a753dbefc
5 changed files with 15 additions and 6 deletions

View File

@ -426,7 +426,7 @@ command : assignment
arg = xcalloc(1, sizeof *arg);
arg->type = CMD_PARSE_STRING;
arg->string = xstrdup($2);
arg->string = $2;
TAILQ_INSERT_HEAD(&$$->arguments, arg, entry);
}
| optional_assignment TOKEN arguments
@ -443,7 +443,7 @@ command : assignment
arg = xcalloc(1, sizeof *arg);
arg->type = CMD_PARSE_STRING;
arg->string = xstrdup($2);
arg->string = $2;
TAILQ_INSERT_HEAD(&$$->arguments, arg, entry);
}
@ -543,13 +543,13 @@ argument : TOKEN
{
$$ = xcalloc(1, sizeof *$$);
$$->type = CMD_PARSE_STRING;
$$->string = xstrdup($1);
$$->string = $1;
}
| EQUALS
{
$$ = xcalloc(1, sizeof *$$);
$$->type = CMD_PARSE_STRING;
$$->string = xstrdup($1);
$$->string = $1;
}
| '{' argument_statements
{
@ -817,7 +817,6 @@ cmd_parse_build_command(struct cmd_parse_command *cmd,
goto out;
values[count].type = ARGS_COMMANDS;
values[count].cmdlist = pr->cmdlist;
values[count].cmdlist->references++;
break;
}
count++;