mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.0880: leaking memory when using searchcount()
Problem: Leaking memory when using searchcount(). Solution: Free the last used search pattern.
This commit is contained in:
@@ -4147,6 +4147,7 @@ f_searchcount(typval_T *argvars, typval_T *rettv)
|
|||||||
{
|
{
|
||||||
if (*pattern == NUL)
|
if (*pattern == NUL)
|
||||||
goto the_end;
|
goto the_end;
|
||||||
|
vim_free(spats[last_idx].pat);
|
||||||
spats[last_idx].pat = vim_strsave(pattern);
|
spats[last_idx].pat = vim_strsave(pattern);
|
||||||
}
|
}
|
||||||
if (spats[last_idx].pat == NULL || *spats[last_idx].pat == NUL)
|
if (spats[last_idx].pat == NULL || *spats[last_idx].pat == NUL)
|
||||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
880,
|
||||||
/**/
|
/**/
|
||||||
879,
|
879,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user