summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-string.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-11-16 11:15:44 +0000
committernicm <nicm@openbsd.org>2009-11-16 11:15:44 +0000
commita3f977f54967a485785bd0038898c5332548f370 (patch)
treef1b8fa41b8f65e9f43040bf029aabe1e03bf4490 /usr.bin/tmux/cmd-string.c
parentKill dead code. (diff)
downloadwireguard-openbsd-a3f977f54967a485785bd0038898c5332548f370.tar.xz
wireguard-openbsd-a3f977f54967a485785bd0038898c5332548f370.zip
I made a complete horlicks of the last change, fix it so it doesn't either lead
to a double free or free the item after the end of the array.
Diffstat (limited to 'usr.bin/tmux/cmd-string.c')
-rw-r--r--usr.bin/tmux/cmd-string.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-string.c b/usr.bin/tmux/cmd-string.c
index a2f4e01bdaa..f18d97f5d32 100644
--- a/usr.bin/tmux/cmd-string.c
+++ b/usr.bin/tmux/cmd-string.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-string.c,v 1.8 2009/11/11 18:56:07 nicm Exp $ */
+/* $OpenBSD: cmd-string.c,v 1.9 2009/11/16 11:15:44 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -151,10 +151,6 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, char **cause)
if (*cmdlist == NULL)
goto out;
- do
- xfree(argv[argc - 1]);
- while (--argc > 0);
-
rval = 0;
goto out;
case '~':
@@ -189,7 +185,7 @@ out:
if (argv != NULL) {
for (i = 0; i < argc; i++)
- xfree(argv[argc]);
+ xfree(argv[i]);
xfree(argv);
}