mirror of
https://github.com/tmux/tmux.git
synced 2025-03-25 23:38:48 +00:00
Fix memory leak in window tree search, from Amos Bird.
This commit is contained in:
parent
ec81bd2399
commit
82c789ee58
@ -785,7 +785,8 @@ window_tree_search(__unused void *modedata, void *itemdata, const char *ss)
|
|||||||
struct session *s;
|
struct session *s;
|
||||||
struct winlink *wl;
|
struct winlink *wl;
|
||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
const char *cmd;
|
char *cmd;
|
||||||
|
int retval;
|
||||||
|
|
||||||
window_tree_pull_item(item, &s, &wl, &wp);
|
window_tree_pull_item(item, &s, &wl, &wp);
|
||||||
|
|
||||||
@ -806,7 +807,9 @@ window_tree_search(__unused void *modedata, void *itemdata, const char *ss)
|
|||||||
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')
|
||||||
return (0);
|
return (0);
|
||||||
return (strstr(cmd, ss) != NULL);
|
retval = (strstr(cmd, ss) != NULL);
|
||||||
|
free(cmd);
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user