diff options
author | 2009-11-16 11:15:44 +0000 | |
---|---|---|
committer | 2009-11-16 11:15:44 +0000 | |
commit | a3f977f54967a485785bd0038898c5332548f370 (patch) | |
tree | f1b8fa41b8f65e9f43040bf029aabe1e03bf4490 /usr.bin/tmux/cmd-string.c | |
parent | Kill dead code. (diff) | |
download | wireguard-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.c | 8 |
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); } |