diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/search.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c index adb7376ce3..ba7c5efa83 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -4607,6 +4607,7 @@ void f_searchcount(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (*pattern == NUL) { goto the_end; } + xfree(spats[last_idx].pat); spats[last_idx].pat = vim_strsave(pattern); } if (spats[last_idx].pat == NULL || *spats[last_idx].pat == NUL) { |