diff options
Diffstat (limited to 'cmd-parse.y')
-rw-r--r-- | cmd-parse.y | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/cmd-parse.y b/cmd-parse.y index a51e4f6e..2c924010 100644 --- a/cmd-parse.y +++ b/cmd-parse.y @@ -176,18 +176,18 @@ expanded : format struct cmd_parse_input *pi = ps->input; struct format_tree *ft; struct client *c = pi->c; - struct cmd_find_state *fs; + struct cmd_find_state *fsp; + struct cmd_find_state fs; int flags = FORMAT_NOJOBS; if (cmd_find_valid_state(&pi->fs)) - fs = &pi->fs; - else - fs = NULL; + fsp = &pi->fs; + else { + cmd_find_from_client(&fs, c, 0); + fsp = &fs; + } ft = format_create(NULL, pi->item, FORMAT_NONE, flags); - if (fs != NULL) - format_defaults(ft, c, fs->s, fs->wl, fs->wp); - else - format_defaults(ft, c, NULL, NULL, NULL); + format_defaults(ft, c, fsp->s, fsp->wl, fsp->wp); $$ = format_expand(ft, $1); format_free(ft); @@ -696,6 +696,7 @@ cmd_parse_build_commands(struct cmd_parse_commands *cmds, pr.status = CMD_PARSE_ERROR; pr.error = cmd_parse_get_error(pi->file, line, cause); free(cause); + cmd_list_free(cmdlist); goto out; } cmd_list_append(cmdlist, add); |