mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 10:08:47 +00:00
And get it right this time... don't leak if it is an empty string either.
This commit is contained in:
parent
17ec688ced
commit
98b81e9834
9
format.c
9
format.c
@ -357,9 +357,12 @@ format_get_command(struct window_pane *wp)
|
|||||||
|
|
||||||
cmd = get_proc_name(wp->fd, wp->tty);
|
cmd = get_proc_name(wp->fd, wp->tty);
|
||||||
if (cmd == NULL || *cmd == '\0') {
|
if (cmd == NULL || *cmd == '\0') {
|
||||||
cmd = wp->cmd;
|
free(cmd);
|
||||||
if (cmd == NULL || *cmd == '\0')
|
cmd = xstrdup(wp->cmd);
|
||||||
cmd = wp->shell;
|
if (cmd == NULL || *cmd == '\0') {
|
||||||
|
free(cmd);
|
||||||
|
cmd = xstrdup(wp->shell);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
out = parse_window_name(cmd);
|
out = parse_window_name(cmd);
|
||||||
free(cmd);
|
free(cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user