mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1638: leaking memory when popup filter function can't be called
Problem: Leaking memory when popup filter function can't be called. Solution: Don't return too soon.
This commit is contained in:
@@ -3155,11 +3155,12 @@ invoke_popup_filter(win_T *wp, int c)
|
||||
if (call_callback(&wp->w_filter_cb, -1, &rettv, 2, argv) == FAIL)
|
||||
{
|
||||
// Cannot call the function, close the popup to avoid that the filter
|
||||
// eats keys and the user can't get out.
|
||||
// eats keys and the user is stuck. Might as well eat the key.
|
||||
popup_close_with_retval(wp, -1);
|
||||
return 1;
|
||||
res = TRUE;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (win_valid_popup(wp) && old_lnum != wp->w_cursor.lnum)
|
||||
popup_highlight_curline(wp);
|
||||
|
||||
@@ -3181,6 +3182,7 @@ invoke_popup_filter(win_T *wp, int c)
|
||||
--wp->w_filter_errors;
|
||||
res = tv_get_bool(&rettv);
|
||||
}
|
||||
}
|
||||
|
||||
vim_free(argv[1].vval.v_string);
|
||||
clear_tv(&rettv);
|
||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1638,
|
||||
/**/
|
||||
1637,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user