summaryrefslogtreecommitdiffstats
path: root/cmd-list.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-02-16 18:57:16 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-02-16 18:57:16 +0000
commit4573ef18691bb5492089265f335dc661aa9fc657 (patch)
tree1ccb43536eb1d250bdc79cfdbd649d841fde8b29 /cmd-list.c
parenta4f5d127e2a444189cf8ae6bb57c53877e6b9a62 (diff)
Memory leak.
Diffstat (limited to 'cmd-list.c')
-rw-r--r--cmd-list.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cmd-list.c b/cmd-list.c
index 870de3da..963d49fe 100644
--- a/cmd-list.c
+++ b/cmd-list.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-list.c,v 1.2 2009-01-19 18:23:40 nicm Exp $ */
+/* $Id: cmd-list.c,v 1.3 2009-02-16 18:57:16 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -47,10 +47,8 @@ cmd_list_parse(int argc, char **argv, char **cause)
}
cmd = cmd_parse(argc - lastsplit, argv + lastsplit, cause);
- if (cmd == NULL) {
- cmd_list_free(cmdlist);
- return (NULL);
- }
+ if (cmd == NULL)
+ goto bad;
TAILQ_INSERT_TAIL(cmdlist, cmd, qentry);
return (cmdlist);