diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-11-18 01:24:33 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-11-18 01:24:33 +0000 |
commit | 063a474fe055cadcb7f7f64e5061ed65d506c407 (patch) | |
tree | 24db0690dc9bd0c6fa2d471d8d5f5e7792b215f9 /cmd-string.c | |
parent | a7158784f2233b9f285615272bc6e8a066083424 (diff) |
Sync OpenBSD patchset 541:
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 'cmd-string.c')
-rw-r--r-- | cmd-string.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cmd-string.c b/cmd-string.c index 69cc9b6e..2ca21983 100644 --- a/cmd-string.c +++ b/cmd-string.c @@ -1,4 +1,4 @@ -/* $Id: cmd-string.c,v 1.25 2009-11-13 16:55:10 tcunha Exp $ */ +/* $Id: cmd-string.c,v 1.26 2009-11-18 01:24:33 tcunha 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); } |