commit | 109aece79d1b5f14f6a84ff2ac068cfffebeba80 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Mon Jun 01 19:08:54 2020 +0200 |
committer | Bram Moolenaar <Bram@vim.org> | Mon Jun 01 19:08:54 2020 +0200 |
tree | 0196e6848b8765e3296f601de7010a2fba156c1b | |
parent | f9ca08e95ff5b66a02c75334264dd86508b2a453 [diff] [blame] |
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 index e0b0f9b..a6b60f6 100644 --- a/src/search.c +++ b/src/search.c
@@ -4147,6 +4147,7 @@ { 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)