Fix leak in format_get_command.

pull/1/head
nicm 2013-10-10 23:31:03 +00:00
parent d0566a474a
commit 0b77d17b35
1 changed files with 4 additions and 2 deletions

View File

@ -353,7 +353,7 @@ format_expand(struct format_tree *ft, const char *fmt)
char *
format_get_command(struct window_pane *wp)
{
char *cmd;
char *cmd, *out;
cmd = get_proc_name(wp->fd, wp->tty);
if (cmd == NULL || *cmd == '\0') {
@ -361,7 +361,9 @@ format_get_command(struct window_pane *wp)
if (cmd == NULL || *cmd == '\0')
cmd = wp->shell;
}
return (parse_window_name(cmd));
out = parse_window_name(cmd);
free(cmd);
return (out);
}
/* Set default format keys for a session. */