summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-parse.y
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-08-23 11:04:22 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-08-23 11:04:22 +0000
commit78c2c963c1b9ff88160dc0240092a849751520a7 (patch)
treef220340e0a20b9ffacb9e247cc63753530c0bc49 /usr.bin/tmux/cmd-parse.y
parente00babe98f49d94492059d694a779b7b5df21f7a (diff)
Fix a few memory leaks.
Diffstat (limited to 'usr.bin/tmux/cmd-parse.y')
-rw-r--r--usr.bin/tmux/cmd-parse.y11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-parse.y b/usr.bin/tmux/cmd-parse.y
index d5c3883ac25..10519d2b5e9 100644
--- a/usr.bin/tmux/cmd-parse.y
+++ b/usr.bin/tmux/cmd-parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-parse.y,v 1.42 2021/08/22 13:00:28 nicm Exp $ */
+/* $OpenBSD: cmd-parse.y,v 1.43 2021/08/23 11:04:21 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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++;