mirror of
https://github.com/tmux/tmux.git
synced 2026-03-05 23:35:35 +00:00
Do not leak list on failure, reported by Huihui Huang.
This commit is contained in:
5
status.c
5
status.c
@@ -1890,7 +1890,7 @@ status_prompt_complete_window_menu(struct client *c, struct session *s,
|
|||||||
struct winlink *wl;
|
struct winlink *wl;
|
||||||
char **list = NULL, *tmp;
|
char **list = NULL, *tmp;
|
||||||
u_int lines = status_line_size(c), height;
|
u_int lines = status_line_size(c), height;
|
||||||
u_int py, size = 0;
|
u_int py, size = 0, i;
|
||||||
|
|
||||||
if (c->tty.sy - lines < 3)
|
if (c->tty.sy - lines < 3)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@@ -1969,6 +1969,9 @@ status_prompt_complete_window_menu(struct client *c, struct session *s,
|
|||||||
BOX_LINES_DEFAULT, NULL, NULL, NULL, NULL,
|
BOX_LINES_DEFAULT, NULL, NULL, NULL, NULL,
|
||||||
status_prompt_menu_callback, spm) != 0) {
|
status_prompt_menu_callback, spm) != 0) {
|
||||||
menu_free(menu);
|
menu_free(menu);
|
||||||
|
for (i = 0; i < size; i++)
|
||||||
|
free(list[i]);
|
||||||
|
free(list);
|
||||||
free(spm);
|
free(spm);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user