summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-11-16 11:15:45 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-11-16 11:15:45 +0000
commit12f67d394eebe8fd0732202a8a08e33aafd6bdfd (patch)
treee7c6b8f430f08e21e3a531c097b2696812a8087c /usr.bin
parent2c4f9f5e7d0a36b9e05fb6c3a79c8b93f9f35731 (diff)
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')
-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);
}