# HG changeset patch # User Bram Moolenaar # Date 1591031703 -7200 # Node ID a68591fbb93d82e4662aba4d80d926e0ab7bf3ce # Parent a0550466b57bb40069f952d96e9c9c49288a5c4c patch 8.2.0880: leaking memory when using searchcount() Commit: https://github.com/vim/vim/commit/109aece79d1b5f14f6a84ff2ac068cfffebeba80 Author: Bram Moolenaar Date: Mon Jun 1 19:08:54 2020 +0200 patch 8.2.0880: leaking memory when using searchcount() Problem: Leaking memory when using searchcount(). Solution: Free the last used search pattern. diff --git a/src/search.c b/src/search.c --- a/src/search.c +++ b/src/search.c @@ -4147,6 +4147,7 @@ f_searchcount(typval_T *argvars, typval_ { if (*pattern == NUL) goto the_end; + vim_free(spats[last_idx].pat); spats[last_idx].pat = vim_strsave(pattern); } if (spats[last_idx].pat == NULL || *spats[last_idx].pat == NUL) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 880, +/**/ 879, /**/ 878,